﻿<ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:Converters="clr-namespace:BillsManager.Views.Converters" xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" xmlns:Controls="clr-namespace:BillsManager.Views.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Ignorable="d" xmlns:Models="clr-namespace:BillsManager.Models;assembly=BillsManager.Models" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
  <SolidColorBrush x:Key="View.Background" Color="White" />
  <SolidColorBrush x:Key="View.BorderBrush" Color="#FF4E4E4E" />
  <SolidColorBrush x:Key="View.Title.Foreground" Color="{Binding Source={StaticResource View.BorderBrush}, Path=Color}" />
  <System:Double x:Key="View.Title.FontSize">16</System:Double>
  <FontWeight x:Key="View.Title.FontWeight">SemiBold</FontWeight>
  <SolidColorBrush x:Key="View.Foreground.Normal" Color="#FF2E2E2E" />
  <SolidColorBrush x:Key="View.Foreground.Disabled" Color="#FFA0A0A0" />
  <SolidColorBrush x:Key="PaidBrush" Color="#FF00B400" />
  <SolidColorBrush x:Key="NotPaidBrush" Color="#FFE44141" />
  <SolidColorBrush x:Key="Control.Background.Normal" Color="#FF22A4FF" />
  <SolidColorBrush x:Key="Control.BorderBrush.Normal" Color="#FF22A4FF" />
  <SolidColorBrush x:Key="Control.Background.Disabled" Color="#FFCCEAFF" />
  <SolidColorBrush x:Key="Control.BorderBrush.Disabled" Color="{Binding Source={StaticResource Control.Background.Disabled}, Path=Color}" />
  <SolidColorBrush x:Key="ErrorTemplate.BorderBrush" Color="#FFE44141" />
  <SolidColorBrush x:Key="ErrorTemplate.BackgroundBrush" Color="#FFE44141" />
  <SolidColorBrush x:Key="ErrorTemplate.ForegroundBrush" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="WarningBackgroundBrush" Color="#FFFF8900" />
  <SolidColorBrush x:Key="WarningForegroundBrush" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="StatusBar.Foreground" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <System:Double x:Key="View.FontSize">11</System:Double>
  <System:Double x:Key="Control.Border.CornerRadius.Value">0</System:Double>
  <CornerRadius x:Key="Control.Border.CornerRadius" BottomLeft="{StaticResource Control.Border.CornerRadius.Value}" BottomRight="{StaticResource Control.Border.CornerRadius.Value}" TopLeft="{StaticResource Control.Border.CornerRadius.Value}" TopRight="{StaticResource Control.Border.CornerRadius.Value}" />
  <CornerRadius x:Key="ViewWindow.Border.CornerRadius">0</CornerRadius>
  <Thickness x:Key="ViewWindow.ResizeBorder.Thickness">5</Thickness>
  <System:Double x:Key="View.Border.Thickness.Value">1</System:Double>
  <Thickness x:Key="View.Border.Thickness" Bottom="{StaticResource View.Border.Thickness.Value}" Left="{StaticResource View.Border.Thickness.Value}" Right="{StaticResource View.Border.Thickness.Value}" Top="{StaticResource View.Border.Thickness.Value}" />
  <Thickness x:Key="View.Border.Padding.Normal">0</Thickness>
  <Thickness x:Key="View.Border.Padding.Maximized">7</Thickness>
  <System:Double x:Key="View.MarginSize.Value">8</System:Double>
  <GridLength x:Key="View.MarginSize">8</GridLength>
  <System:Double x:Key="View.Region.Spacing.SmallValue">4</System:Double>
  <GridLength x:Key="View.Region.Spacing.Small">4</GridLength>
  <GridLength x:Key="View.Region.Spacing.Normal">8</GridLength>
  <GridLength x:Key="View.Region.Spacing.Medium">24</GridLength>
  <GridLength x:Key="View.Region.Spacing.Large">32</GridLength>
  <System:Double x:Key="View.Region.Title.FontSize">16</System:Double>
  <FontWeight x:Key="View.Region.Title.FontWeight">SemiBold</FontWeight>
  <SolidColorBrush x:Key="View.Region.Title.Foreground" Color="{Binding Source={StaticResource Control.BorderBrush.Normal}, Path=Color}" />
  <Visibility x:Key="View.Region.Title.Visibility">Visible</Visibility>
  <System:Double x:Key="Separator.Size">1</System:Double>
  <System:Double x:Key="Menu.Icon.Size.Value">26</System:Double>
  <System:Double x:Key="View.Icon.Size">24</System:Double>
  <System:Double x:Key="MenuItem.IconSize">16</System:Double>
  <System:Double x:Key="Path.Size.Value">10</System:Double>
  <Size x:Key="Path.Size" Width="{StaticResource Path.Size.Value}" Height="{StaticResource Path.Size.Value}" />
  <SolidColorBrush x:Key="Button.Background.Normal" Color="#FF22A4FF" />
  <SolidColorBrush x:Key="Button.BorderBrush.Normal" Color="{Binding Source={StaticResource Button.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="Button.Foreground.Normal" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="Button.Background.Hover" Color="#FF64C1FF" />
  <SolidColorBrush x:Key="Button.BorderBrush.Hover" Color="{Binding Source={StaticResource Button.Background.Hover}, Path=Color}" />
  <SolidColorBrush x:Key="Button.Foreground.Hover" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="Button.Background.Pressed" Color="#FF0082D9" />
  <SolidColorBrush x:Key="Button.BorderBrush.Pressed" Color="{Binding Source={StaticResource Button.Background.Pressed}, Path=Color}" />
  <SolidColorBrush x:Key="Button.Foreground.Pressed" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="Button.Background.Focused" Color="{Binding Source={StaticResource Button.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="Button.BorderBrush.Focused" Color="{Binding Source={StaticResource Button.BorderBrush.Pressed}, Path=Color}" />
  <SolidColorBrush x:Key="Button.Foreground.Focused" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="Button.Background.Disabled" Color="{Binding Source={StaticResource Control.Background.Disabled}, Path=Color}" />
  <SolidColorBrush x:Key="Button.BorderBrush.Disabled" Color="{Binding Source={StaticResource Button.Background.Disabled}, Path=Color}" />
  <SolidColorBrush x:Key="Button.Foreground.Disabled" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="DefaultButton.Background.Normal" Color="#FF34C234" />
  <SolidColorBrush x:Key="DefaultButton.BorderBrush.Normal" Color="{Binding Source={StaticResource DefaultButton.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="DefaultButton.Foreground.Normal" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="DefaultButton.Background.Hover" Color="#FF71D871" />
  <SolidColorBrush x:Key="DefaultButton.BorderBrush.Hover" Color="{Binding Source={StaticResource DefaultButton.Background.Hover}, Path=Color}" />
  <SolidColorBrush x:Key="DefaultButton.Foreground.Hover" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="DefaultButton.Background.Pressed" Color="#FF2BA62B" />
  <SolidColorBrush x:Key="DefaultButton.BorderBrush.Pressed" Color="{Binding Source={StaticResource DefaultButton.Background.Pressed}, Path=Color}" />
  <SolidColorBrush x:Key="DefaultButton.Foreground.Pressed" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="DefaultButton.Background.Focused" Color="{Binding Source={StaticResource DefaultButton.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="DefaultButton.BorderBrush.Focused" Color="{Binding Source={StaticResource DefaultButton.BorderBrush.Pressed}, Path=Color}" />
  <SolidColorBrush x:Key="DefaultButton.Foreground.Focused" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="DefaultButton.Background.Disabled" Color="#FFBEF2BE" />
  <SolidColorBrush x:Key="DefaultButton.BorderBrush.Disabled" Color="{Binding Source={StaticResource DefaultButton.Background.Disabled}, Path=Color}" />
  <SolidColorBrush x:Key="DefaultButton.Foreground.Disabled" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="CancelButton.Background.Normal" Color="#FFE44141" />
  <SolidColorBrush x:Key="CancelButton.BorderBrush.Normal" Color="{Binding Source={StaticResource CancelButton.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="CancelButton.Foreground.Normal" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="CancelButton.Background.Hover" Color="#FFF76666" />
  <SolidColorBrush x:Key="CancelButton.BorderBrush.Hover" Color="{Binding Source={StaticResource CancelButton.Background.Hover}, Path=Color}" />
  <SolidColorBrush x:Key="CancelButton.Foreground.Hover" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="CancelButton.Background.Pressed" Color="#FFCF2828" />
  <SolidColorBrush x:Key="CancelButton.BorderBrush.Pressed" Color="{Binding Source={StaticResource CancelButton.Background.Pressed}, Path=Color}" />
  <SolidColorBrush x:Key="CancelButton.Foreground.Pressed" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="CancelButton.Background.Focused" Color="{Binding Source={StaticResource CancelButton.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="CancelButton.BorderBrush.Focused" Color="{Binding Source={StaticResource CancelButton.BorderBrush.Pressed}, Path=Color}" />
  <SolidColorBrush x:Key="CancelButton.Foreground.Focused" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="CancelButton.Background.Disabled" Color="#FFFFD3D3" />
  <SolidColorBrush x:Key="CancelButton.BorderBrush.Disabled" Color="{Binding Source={StaticResource CancelButton.Background.Disabled}, Path=Color}" />
  <SolidColorBrush x:Key="CancelButton.Foreground.Disabled" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <Thickness x:Key="ControlBox.Buttons.BorderThickness">0</Thickness>
  <Thickness x:Key="ControlBox.Buttons.Padding">4</Thickness>
  <Size x:Key="ControlBox.Buttons.Size" Width="28" Height="22" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Close.Background.Normal" Color="Transparent" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Close.BorderBrush.Normal" Color="{Binding Source={StaticResource ControlBox.Buttons.Close.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Close.Foreground.Normal" Color="{Binding Source={StaticResource View.BorderBrush}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Close.Background.Hover" Color="{Binding Source={StaticResource ControlBox.Buttons.Close.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Close.BorderBrush.Hover" Color="{Binding Source={StaticResource ControlBox.Buttons.Close.BorderBrush.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Close.Foreground.Hover" Color="{Binding Source={StaticResource CancelButton.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Close.Background.Pressed" Color="{Binding Source={StaticResource ControlBox.Buttons.Close.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Close.BorderBrush.Pressed" Color="{Binding Source={StaticResource ControlBox.Buttons.Close.BorderBrush.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Close.Foreground.Pressed" Color="{Binding Source={StaticResource CancelButton.Background.Pressed}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Generic.Background.Normal" Color="Transparent" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Generic.BorderBrush.Normal" Color="{Binding Source={StaticResource ControlBox.Buttons.Close.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Generic.Foreground.Normal" Color="{Binding Source={StaticResource View.BorderBrush}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Generic.Background.Hover" Color="{Binding Source={StaticResource ControlBox.Buttons.Generic.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Generic.BorderBrush.Hover" Color="{Binding Source={StaticResource ControlBox.Buttons.Generic.BorderBrush.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Generic.Foreground.Hover" Color="{Binding Source={StaticResource Button.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Generic.Background.Pressed" Color="{Binding Source={StaticResource ControlBox.Buttons.Generic.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Generic.BorderBrush.Pressed" Color="{Binding Source={StaticResource ControlBox.Buttons.Generic.BorderBrush.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ControlBox.Buttons.Generic.Foreground.Pressed" Color="{Binding Source={StaticResource Button.Background.Pressed}, Path=Color}" />
  <Geometry x:Key="SizeEnsurer">M 0,0 L 10,10 L 0,0</Geometry>
  <Geometry x:Key="CloseGeometry">M 1.5,0 L 4.5,3 L 7.5,0 L 9,1.5 L 6,4.5 L 9,7.5 L 7.5,9 L 4.5,6 L 1.5,9 L 0,7.5 L 3,4.5 L 0,1.5 Z</Geometry>
  <Geometry x:Key="MaximizeGeometry">M 0,0 L 10,0 L 10,10 L 0,10 L 0,0 L 2,2 L 8,2 L 8,8 L 2,8 L 2,2 L 0,0 Z</Geometry>
  <CombinedGeometry x:Key="NormalizeGeometry" GeometryCombineMode="Exclude">
    <CombinedGeometry.Geometry1>
      <CombinedGeometry Geometry1="{StaticResource MaximizeGeometry}" GeometryCombineMode="Union">
        <CombinedGeometry.Geometry2>
          <CombinedGeometry Geometry1="{StaticResource MaximizeGeometry}">
            <CombinedGeometry.Transform>
              <TransformGroup>
                <TranslateTransform X="2" Y="-2" />
              </TransformGroup>
            </CombinedGeometry.Transform>
          </CombinedGeometry>
        </CombinedGeometry.Geometry2>
      </CombinedGeometry>
    </CombinedGeometry.Geometry1>
    <CombinedGeometry.Geometry2>
      <CombinedGeometry Geometry1="M 0,0 L 10,0 L 10,10 L 0,10 L 0,0 Z" Geometry2="{StaticResource MaximizeGeometry}" GeometryCombineMode="Xor" />
    </CombinedGeometry.Geometry2>
  </CombinedGeometry>
  <Geometry x:Key="MinimizeGeometry">M 0,0 L 0,8 L 10,8 L 10,10 L 0,10 L 0,8 Z</Geometry>
  <Geometry x:Key="NullCheckedGeometry">M 0,0 L 10,0 L 10,10 L 0,10 Z</Geometry>
  <Geometry x:Key="Checkmark">M 0,5.1 L 1.7,5.2 L 3.4,7.1 L 8,0.4 L 9.2,0 L 3.3,10.8 Z</Geometry>
  <Geometry x:Key="Checkmark2">M 0 2 L 0 4.85 L 2.5 7.4 L 7.1 2.8 L 7.1 0 L 2.5 4.6 Z</Geometry>
  <Geometry x:Key="Checkmark3">M 0,3 L 0,6 L 3,9 L 9,3 L 9,0 L 3,6 Z</Geometry>
  <Geometry x:Key="Plus">M 2,0 L 4,0 L 4,2 L 6,2 L 6,4 L 4,4 L 4,6 L 2,6 L 2,4 L 0,4 L 0,2 L 2,2 L 2,0 Z</Geometry>
  <Geometry x:Key="Plus2">M 3,0 L 6,0 L 6,3 L 9,3 L 9,6 L 6,6 L 6,9 L 3,9 L 3,6 L 0,6 L 0,3 L 3,3 L 3,0 Z</Geometry>
  <Geometry x:Key="Plus3">M 3.4,0 L 5.6,0 L 5.6,3.4 L 9,3.4 L 9,5.6 L 5.6,5.6 L 5.6,9 L 3.4,9 L 3.4,5.6 L 0,5.6 L 0,3.4 L 3.4,3.4 L 3.4,0 Z</Geometry>
  <Geometry x:Key="Arrow.Up.Triangle">M 5,0.5 L 10,8 L 0,8 L 5,0.5 L 0,0 L 10,10 L 0,0 Z</Geometry>
  <Geometry x:Key="Arrow.Up.Metro">M 5,0.5 L 10,5.5 L 10,9 L 5,4 L 0,9 L 0,5.5 L 0,0 L 10,10 L 0,0 L 0,5.5 Z</Geometry>
  <Geometry x:Key="Arrow.Up.Simple">M 5,1.5 L 10,6.5 L 8.25,8.25 L 5,5 L 1.75,8.25 L 0,6.5 L 0,0 L 10,10 L 0,0 L 0,6.5 Z</Geometry>
  <Geometry x:Key="Arrow.Down.Triangle">M 0,1 L 10,1 L 5,9 L 0,1 L 0,0 L 10,10 L 0,0  Z</Geometry>
  <Geometry x:Key="Arrow.Down.Metro">M 0,0 L 0,1 L 4.5,5.5 L 9,1 L 9,4.5 L 4.5,9 L 0,4.5 L 0,1 Z</Geometry>
  <Geometry x:Key="Arrow.Down.Simple">M 0,0 L 0,1 L 4.5,5.5 L 9,1 L 9,4.5 L 4.5,9 L 0,4.5 L 0,1 Z</Geometry>
  <Geometry x:Key="Arrow.Right.Triangle">M 2,0 L 9.5,5 L 2,10 Z</Geometry>
  <Geometry x:Key="Arrow.Right.Metro">M 0,0 L 1,0 L 4.5,0 L 9,4.5 L 4.5,9 L 1,9 L 5.5,4.5 L 1,0 Z</Geometry>
  <Geometry x:Key="Arrow.Left.Triangle">M 0.5,5 L 8,0 L 8,10 Z</Geometry>
  <Geometry x:Key="Arrow.Left.Metro">M 0,4.5 L 4.5,0 L 8,0 L 9,0 L 8,0 L 3.5,4.5 L 8,9 L 4.5,9 Z</Geometry>
  <GeometryGroup x:Key="LastRightGeometry">
    <Geometry>M 0,0 L 3.5,0 L 8,4.5 L 3.5,9 L 0,9 L 4.5,4.5 Z</Geometry>
    <Geometry>M 8,0 L 10,0 L 10,9 L 8,9 Z</Geometry>
  </GeometryGroup>
  <GeometryGroup x:Key="LastLeftGeometry">
    <Geometry>M 0,0 L 2,0 L 2,9 L 0,9 Z</Geometry>
    <Geometry>M 2,4.5 L 6.5,0 L 10,0 L 5.5,4.5 L 10,9 L 6.5,9 Z</Geometry>
  </GeometryGroup>
  <Geometry x:Key="ExpanderLeftArrow">M 1,1.5 L 4.5,5 L 8,1.5</Geometry>
  <Geometry x:Key="ExpanderUpArrow">M 1,5 L 4.5,1.5 L 8,5</Geometry>
  <Geometry x:Key="ExpanderRightArrow">M 1.5,1 L 5,4.5 L 1.5,8</Geometry>
  <Geometry x:Key="ExpanderDownArrow">M 1,1.5 L 4.5,5 L 8,1.5</Geometry>
  <Geometry x:Key="RoundClose">F1M54.0573,47.8776L38.1771,31.9974 54.0547,16.1198C55.7604,14.4141 55.7604,11.6511 54.0573,9.94531 52.3516,8.23962 49.5859,8.23962 47.8802,9.94531L32.0026,25.8229 16.1224,9.94531C14.4167,8.23962 11.6511,8.23962 9.94794,9.94531 8.24219,11.6511 8.24219,14.4141 9.94794,16.1198L25.8255,32 9.94794,47.8776C8.24219,49.5834 8.24219,52.3477 9.94794,54.0534 11.6511,55.7572 14.4167,55.7585 16.1224,54.0534L32.0026,38.1745 47.8802,54.0534C49.5859,55.7585 52.3516,55.7572 54.0573,54.0534 55.7604,52.3477 55.763,49.5834 54.0573,47.8776z</Geometry>
  <Geometry x:Key="RestoreSize">M4.3685131,23.127279L4.3685131,47.283243 47.117023,47.283243 47.117023,23.127279z M0,10.684L53.755001,10.684 53.755001,51.668001 0,51.668001z M8.5679998,0L58.668022,0 64,0 64,5.6864691 64,45.317999 58.668022,45.317999 58.668022,5.6864691 8.5679998,5.6864691z</Geometry>
  <Geometry x:Key="Minimize">M0,20L53.333,20 53.333,8.888 0,8.888z</Geometry>
  <Geometry x:Key="TopRightLittleCorner">M 0,0 L 8,0 L 8,8 Z</Geometry>
  <GeometryGroup x:Key="SaveGeometry">
    <GeometryGroup.Children>
      <Geometry>M 0,0 L 10,0 L 12,2 L 12,12 L 0,12 Z</Geometry>
      <Geometry>M 1,12 L 1,5.5 L 1.5,5 L 10.5,5 L 11,5.5 L 11,12 Z</Geometry>
      <Geometry>M 4,0 L 9,0 L 9,3 L 4,3 Z</Geometry>
      <Geometry>M 7,0 L 8,0 L 8,2 L 7,2 Z</Geometry>
      <Geometry>M 1,12 L 11,12 L 11,11 L 1,11 Z</Geometry>
    </GeometryGroup.Children>
  </GeometryGroup>
  <SolidColorBrush x:Key="Menu.Background.Normal" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="Menu.BorderBrush.Normal" Color="{Binding Source={StaticResource View.BorderBrush}, Path=Color}" />
  <SolidColorBrush x:Key="Menu.Foreground.Normal" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="MenuHoverBackgroundBrush" Color="{Binding Source={StaticResource View.BorderBrush}, Path=Color}" />
  <SolidColorBrush x:Key="MenuHoverBorderBrush" Color="{Binding Source={StaticResource View.BorderBrush}, Path=Color}" />
  <SolidColorBrush x:Key="MenuHoverForegroundBrush" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="MenuPressedBackgroundBrush" Color="#FF106024" />
  <SolidColorBrush x:Key="MenuPressedForegroundBrush" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="MenuPressedBorderBrush" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="MenuDisabledForegroundBrush" Color="#FFC9C9C9" />
  <SolidColorBrush x:Key="MenuDisabledBackgroundBrush" Color="#FFC9C9C9" />
  <SolidColorBrush x:Key="MenuDisabledBorderBrush" Color="#FFC9C9C9" />
  <SolidColorBrush x:Key="MenuItemBackgroundBrush" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="MenuItemBorderBrush" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="MenuItemForegroundBrush" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="MenuItemHoverBackgroundBrush" Color="{Binding Source={StaticResource Button.Background.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="MenuItemHoverBorderBrush" Color="{Binding Source={StaticResource Button.BorderBrush.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="MenuItemHoverForegroundBrush" Color="{Binding Source={StaticResource Button.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="MenuItemPressedBackgroundBrush" Color="{Binding Source={StaticResource Button.Background.Pressed}, Path=Color}" />
  <SolidColorBrush x:Key="MenuItemPressedBorderBrush" Color="{Binding Source={StaticResource Button.BorderBrush.Pressed}, Path=Color}" />
  <SolidColorBrush x:Key="MenuItemPressedForegroundBrush" Color="{Binding Source={StaticResource Button.Foreground.Pressed}, Path=Color}" />
  <SolidColorBrush x:Key="MenuItemDisabledBackgroundBrush" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="MenuItemDisabledBorderBrush" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="MenuItemDisabledForegroundBrush" Color="{Binding Source={StaticResource View.Foreground.Disabled}, Path=Color}" />
  <SolidColorBrush x:Key="MenuItemCheckedBackgroundBrush" Color="#FFB669FF" />
  <SolidColorBrush x:Key="MenuItemCheckedForegroundBrush" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="TextBox.Background.Normal" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="TextBox.BorderBrush.Normal" Color="{Binding Source={StaticResource Control.BorderBrush.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="TextBox.Foreground.Normal" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="TextBox.Background.Disabled" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="TextBox.BorderBrush.Disabled" Color="{Binding Source={StaticResource Control.BorderBrush.Disabled}, Path=Color}" />
  <SolidColorBrush x:Key="TextBox.Foreground.Disabled" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="Obligation.Debtor.Brush" Color="#FF00B400" />
  <SolidColorBrush x:Key="Obligation.Unbound.Brush" Color="Transparent" />
  <SolidColorBrush x:Key="Obligation.Creditor.Brush" Color="{Binding Source={StaticResource NotPaidBrush}, Path=Color}" />
  <Geometry x:Key="Obligation.Debtor.Geometry">M 0,4.5 L 4.5,0 L 9,4.5 L 9,8 L 4.5,3.5 L 0,8 Z</Geometry>
  <Geometry x:Key="Obligation.Null.Geometry">M 0,2 L 9,2 L 9,4 L 0,4 Z</Geometry>
  <Geometry x:Key="Obligation.Creditor.Geometry">M 0,1 L 4.5,5.5 L 9,1 L 9,4.5 L 4.5,9 L 0,4.5 Z</Geometry>
  <SolidColorBrush x:Key="DBConnectionState.NotConnected" Color="#FF9A73D6" />
  <SolidColorBrush x:Key="DBConnectionState.Connected" Color="#FF22A4FF" />
  <SolidColorBrush x:Key="DBConnectionState.Unsaved" Color="#FFFF8900" />
  <System:Double x:Key="Checkbox.Checkmark.Size">9</System:Double>
  <SolidColorBrush x:Key="Checkbox.States.Null.Brush" Color="Gray" />
  <SolidColorBrush x:Key="ListBoxItem.Background.Normal" Color="#FF00C200" />
  <SolidColorBrush x:Key="ListBoxItem.BorderBrush.Normal" Color="#FF00C200" />
  <SolidColorBrush x:Key="ListBoxItem.Foreground.Normal" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ListItem.Background.Alternation.1" Color="Transparent" />
  <SolidColorBrush x:Key="ListItem.Background.Alternation.2" Color="#FFF2F2F2" />
  <SolidColorBrush x:Key="ListItem.Background.Normal" Color="Transparent" />
  <SolidColorBrush x:Key="ListItem.Background.Hover" Color="#FFCCE5FF" />
  <SolidColorBrush x:Key="ListItem.Background.Selected" Color="#FF22A4FF" />
  <SolidColorBrush x:Key="ListItem.Background.Pressed" Color="#FF0074E7" />
  <SolidColorBrush x:Key="ListItem.BorderBrush.Normal" Color="Transparent" />
  <SolidColorBrush x:Key="ListItem.BorderBrush.Hover" Color="#FFCCE5FF" />
  <SolidColorBrush x:Key="ListItem.BorderBrush.Selected" Color="#FF22A4FF" />
  <SolidColorBrush x:Key="ListItem.BorderBrush.Pressed" Color="#FF0074E7" />
  <SolidColorBrush x:Key="ListItem.Foreground.Normal" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ListItem.Foreground.Hover" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ListItem.Foreground.Selected" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="ListItem.Foreground.Pressed" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="ListItem.LineDivider.Brush" Color="#FFC3C3C3" />
  <System:Double x:Key="ListItem.Padding.Value">5</System:Double>
  <Thickness x:Key="ListItem.Padding.Normal" Bottom="{StaticResource ListItem.Padding.Value}" Top="{StaticResource ListItem.Padding.Value}" />
  <Thickness x:Key="ListItem.BorderThickness.Normal" />
  <SolidColorBrush x:Key="NoneDueAlertBrush" Color="Transparent" />
  <SolidColorBrush x:Key="LowDueAlertBrush" Color="#FF00B400" />
  <SolidColorBrush x:Key="MediumDueAlertBrush" Color="#FFFF8500" />
  <SolidColorBrush x:Key="HighDueAlertBrush" Color="#FFE44141" />
  <SolidColorBrush x:Key="CriticalDueAlertBrush" Color="#FFAA1414" />
  <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
  <Converters:RowAlternatorConverter x:Key="RowAlternatorConverter" Color1="{StaticResource ListItem.Background.Alternation.1}" Color2="{StaticResource ListItem.Background.Alternation.2}" />
  <System:Double x:Key="ScrollBar.Border.Thickness.Value">5</System:Double>
  <Thickness x:Key="ScrollBar.Border.Thickness" Bottom="{StaticResource ScrollBar.Border.Thickness.Value}" Left="{StaticResource ScrollBar.Border.Thickness.Value}" Right="{StaticResource ScrollBar.Border.Thickness.Value}" Top="{StaticResource ScrollBar.Border.Thickness.Value}" />
  <System:Double x:Key="ScrollBar.Thickness">13</System:Double>
  <Visibility x:Key="ScrollBar.RepeatButtons.Visibility">Collapsed</Visibility>
  <SolidColorBrush x:Key="ScrollBar.Background.Normal" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.Background.Hover" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.Background.Disabled" Color="#FFECECEC" />
  <SolidColorBrush x:Key="ScrollBar.BorderBrush.Normal" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.BorderBrush.Hover" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.BorderBrush.Disabled" Color="#FFECECEC" />
  <SolidColorBrush x:Key="ScrollBar.Foreground.Normal" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.Foreground.Hover" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.Foreground.Disabled" Color="{Binding Source={StaticResource View.Foreground.Disabled}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.Thumb.Background.Normal" Color="#FFD2D2D2" />
  <SolidColorBrush x:Key="ScrollBar.Thumb.Background.Hover" Color="#FFB8B8B8" />
  <SolidColorBrush x:Key="ScrollBar.Thumb.Background.Dragging" Color="{Binding Source={StaticResource View.Foreground.Disabled}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.Thumb.Background.Disabled" Color="#FFECECEC" />
  <SolidColorBrush x:Key="ScrollBar.Thumb.BorderBrush.Normal" Color="#FFD2D2D2" />
  <SolidColorBrush x:Key="ScrollBar.Thumb.BorderBrush.Hover" Color="#FFB8B8B8" />
  <SolidColorBrush x:Key="ScrollBar.Thumb.BorderBrush.Dragging" Color="{Binding Source={StaticResource View.Foreground.Disabled}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.Thumb.BorderBrush.Disabled" Color="#FFECECEC" />
  <SolidColorBrush x:Key="ScrollBar.Thumb.Foreground.Normal" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.Thumb.Foreground.Hover" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.Thumb.Foreground.Dragging" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.Thumb.Foreground.Disabled" Color="{Binding Source={StaticResource View.Foreground.Disabled}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.RepeatButton.Background.Normal" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.RepeatButton.Background.Hover" Color="#FFD2D2D2" />
  <SolidColorBrush x:Key="ScrollBar.RepeatButton.Background.Pressed" Color="#FFB8B8B8" />
  <SolidColorBrush x:Key="ScrollBar.RepeatButton.Background.Disabled" Color="#FFECECEC" />
  <SolidColorBrush x:Key="ScrollBar.RepeatButton.BorderBrush.Normal" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.RepeatButton.BorderBrush.Hover" Color="#FFD2D2D2" />
  <SolidColorBrush x:Key="ScrollBar.RepeatButton.BorderBrush.Pressed" Color="#FFB8B8B8" />
  <SolidColorBrush x:Key="ScrollBar.RepeatButton.BorderBrush.Disabled" Color="#FFECECEC" />
  <SolidColorBrush x:Key="ScrollBar.RepeatButton.Foreground.Normal" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.RepeatButton.Foreground.Hover" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.RepeatButton.Foreground.Pressed" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="ScrollBar.RepeatButton.Foreground.Disabled" Color="{Binding Source={StaticResource View.Foreground.Disabled}, Path=Color}" />
  <SolidColorBrush x:Key="GridView.ColumnHeader.BorderBrush.Normal" Color="#FFD4D4D4" />
  <SolidColorBrush x:Key="GridView.ColumnHeader.BorderBrush.Hover" Color="#FFD4D4D4" />
  <SolidColorBrush x:Key="GridView.ColumnHeader.BorderBrush.Pressed" Color="#FF838383" />
  <SolidColorBrush x:Key="GridView.ColumnHeader.Background.Normal" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <SolidColorBrush x:Key="GridView.ColumnHeader.Background.Hover" Color="#FFF5F5F5" />
  <SolidColorBrush x:Key="GridView.ColumnHeader.Background.Pressed" Color="#FFA7A7A7" />
  <SolidColorBrush x:Key="GridView.ColumnHeader.Foreground.Normal" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="GridView.ColumnHeader.Foreground.Hover" Color="{Binding Source={StaticResource View.Foreground.Normal}, Path=Color}" />
  <SolidColorBrush x:Key="GridView.ColumnHeader.Foreground.Pressed" Color="{Binding Source={StaticResource View.Background}, Path=Color}" />
  <FontWeight x:Key="GridView.ColumnHeader.FontWeight">SemiBold</FontWeight>
  <Thickness x:Key="GridView.ColumnHeader.BorderThickness.Normal" />
  <Thickness x:Key="GridView.ColumnHeader.BorderThickness.Hover" />
  <Thickness x:Key="GridView.ColumnHeader.BorderThickness.Pressed" />
  <BorderGapMaskConverter x:Key="BorderGapMaskConverter" />
  <Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="{x:Type Separator}">
    <Setter Property="Foreground" Value="{StaticResource Menu.BorderBrush.Normal}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Separator}">
          <Rectangle Width="{TemplateBinding Width}" Fill="{TemplateBinding Foreground}" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=TopLevelItemTemplateKey}" TargetType="{x:Type MenuItem}">
    <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{StaticResource Control.Border.CornerRadius}" Padding="{TemplateBinding Padding}">
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition />
          <RowDefinition x:Name="middleRow" Height="{StaticResource View.Region.Spacing.Small}" />
          <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <ContentPresenter x:Name="Icon" Width="{StaticResource Menu.Icon.Size.Value}" Height="{StaticResource Menu.Icon.Size.Value}" HorizontalAlignment="Center" VerticalAlignment="Center" ContentSource="Icon" />
        <!--
                    <StackPanel Orientation="Horizontal"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center">
                    <Path x:Name="GlyphPanel"
                    Fill="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"
                    Data="{StaticResource ResourceKey=Checkmark}"
                    Visibility="Collapsed"
                    Margin="0,0,4,0"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Center" />
                -->
        <ContentPresenter x:Name="header" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True">
          <ContentPresenter.Margin>
            <Thickness Left="{StaticResource View.Region.Spacing.SmallValue}" Right="{StaticResource View.Region.Spacing.SmallValue}" />
          </ContentPresenter.Margin>
        </ContentPresenter>
        <!--  </StackPanel>  -->
      </Grid>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="Command" Value="{x:Null}">
        <Setter Property="IsEnabled" Value="False" />
      </Trigger>
      <Trigger Property="Icon" Value="{x:Null}">
        <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
        <Setter TargetName="middleRow" Property="Height" Value="0" />
      </Trigger>
      <Trigger Property="Header" Value="{x:Null}">
        <Setter TargetName="header" Property="Visibility" Value="Collapsed" />
        <Setter TargetName="middleRow" Property="Height" Value="0" />
      </Trigger>
      <Trigger Property="IsChecked" Value="true">
        <!--
                    <Setter TargetName="GlyphPanel"
                    Property="Visibility"
                    Value="Visible" />
                    <Setter TargetName="Icon"
                    Property="Visibility"
                    Value="Collapsed" />
                -->
        <Setter TargetName="border" Property="Background" Value="{StaticResource MenuItemCheckedBackgroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource MenuItemCheckedForegroundBrush}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=TopLevelHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{StaticResource Control.Border.CornerRadius}" Padding="{TemplateBinding Padding}">
      <StackPanel>
        <ContentPresenter x:Name="icon" Width="{StaticResource Menu.Icon.Size.Value}" Height="{StaticResource Menu.Icon.Size.Value}" HorizontalAlignment="Center" VerticalAlignment="Center" ContentSource="Icon" />
        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
          <Path x:Name="checkamrk" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{StaticResource Checkmark}" Fill="{TemplateBinding Foreground}" Visibility="Collapsed" />
          <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True" />
        </StackPanel>
        <Popup x:Name="PART_Popup" AllowsTransparency="True" Focusable="false" HorizontalOffset="-9" IsOpen="{TemplateBinding IsSubmenuOpen}" Placement="Bottom" PopupAnimation="None" VerticalOffset="4">
          <Border Background="{StaticResource MenuItemBackgroundBrush}" BorderBrush="{StaticResource Menu.BorderBrush.Normal}" BorderThickness="1">
            <ScrollViewer x:Name="SubMenuScrollViewer" CanContentScroll="true" Style="{StaticResource {ComponentResourceKey ResourceId=MenuScrollViewer,                                                                                    TypeInTargetAssembly={x:Type FrameworkElement}}}">
              <ItemsPresenter Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle" />
            </ScrollViewer>
          </Border>
        </Popup>
      </StackPanel>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsSuspendingPopupAnimation" Value="true">
        <Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None" />
      </Trigger>
      <Trigger Property="Icon" Value="{x:Null}">
        <Setter TargetName="icon" Property="Visibility" Value="Collapsed" />
      </Trigger>
      <Trigger Property="IsChecked" Value="true">
        <Setter TargetName="checkamrk" Property="Visibility" Value="Visible" />
        <Setter TargetName="icon" Property="Visibility" Value="Collapsed" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=SubmenuItemTemplateKey}" TargetType="{x:Type MenuItem}">
    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="0" Padding="{TemplateBinding Padding}">
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto" SharedSizeGroup="icon" />
          <ColumnDefinition />
          <ColumnDefinition Width="50" />
          <ColumnDefinition Width="Auto" SharedSizeGroup="igt" />
          <ColumnDefinition Width="Auto" SharedSizeGroup="arrow" />
        </Grid.ColumnDefinitions>
        <ContentPresenter x:Name="icon" Width="{StaticResource MenuItem.IconSize}" Height="{StaticResource MenuItem.IconSize}" HorizontalAlignment="Center" VerticalAlignment="Center" ContentSource="Icon">
          <ContentPresenter.Margin>
            <Thickness Right="{StaticResource View.MarginSize.Value}" />
          </ContentPresenter.Margin>
        </ContentPresenter>
        <Path x:Name="checkmark" Width="{StaticResource MenuItem.IconSize}" Height="{StaticResource MenuItem.IconSize}" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{StaticResource Checkmark}" Fill="{TemplateBinding Foreground}" Visibility="Hidden">
          <Path.Margin>
            <Thickness Right="{StaticResource View.MarginSize.Value}" />
          </Path.Margin>
        </Path>
        <ContentPresenter Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True" />
        <TextBlock Grid.Column="3" HorizontalAlignment="Right" VerticalAlignment="Center" Text="{TemplateBinding InputGestureText}" />
      </Grid>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="Command" Value="{x:Null}">
        <Setter Property="IsEnabled" Value="False" />
      </Trigger>
      <Trigger Property="Icon" Value="{x:Null}">
        <Setter TargetName="icon" Property="Visibility" Value="Hidden" />
      </Trigger>
      <Trigger Property="IsChecked" Value="true">
        <Setter TargetName="checkmark" Property="Visibility" Value="Visible" />
        <Setter TargetName="icon" Property="Visibility" Value="Hidden" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=SubmenuHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="0">
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto" SharedSizeGroup="icon" />
          <ColumnDefinition />
          <ColumnDefinition Width="50" />
          <ColumnDefinition Width="Auto" SharedSizeGroup="igt" />
          <ColumnDefinition Width="Auto" SharedSizeGroup="arrow" />
        </Grid.ColumnDefinitions>
        <ContentPresenter x:Name="icon" Width="{StaticResource MenuItem.IconSize}" Height="{StaticResource MenuItem.IconSize}" Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" ContentSource="Icon" />
        <Path x:Name="checkmark" Width="{StaticResource MenuItem.IconSize}" Height="{StaticResource MenuItem.IconSize}" Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{StaticResource Checkmark}" Fill="{TemplateBinding Foreground}" Visibility="Hidden" />
        <Popup x:Name="PART_Popup" AllowsTransparency="True" Focusable="false" IsOpen="{TemplateBinding IsSubmenuOpen}" Placement="Right" PopupAnimation="None" VerticalOffset="-1">
          <Border Background="{StaticResource MenuItemBackgroundBrush}" BorderBrush="{StaticResource Menu.BorderBrush.Normal}" BorderThickness="1">
            <ScrollViewer Name="SubMenuScrollViewer" CanContentScroll="true" Style="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type FrameworkElement},                                                                                    ResourceId=MenuScrollViewer}}">
              <ItemsPresenter Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle" />
            </ScrollViewer>
          </Border>
        </Popup>
        <ContentPresenter Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True" />
        <TextBlock Grid.Column="3" Margin="0 0 4 0" HorizontalAlignment="Right" VerticalAlignment="Center" Text="{TemplateBinding InputGestureText}" />
        <Path Grid.Column="4" Margin="0 0 4 0" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{StaticResource Arrow.Right.Metro}" Fill="{TemplateBinding Foreground}" />
      </Grid>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsSuspendingPopupAnimation" Value="true">
        <Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None" />
      </Trigger>
      <Trigger Property="Icon" Value="{x:Null}">
        <Setter TargetName="icon" Property="Visibility" Value="Hidden" />
      </Trigger>
      <Trigger Property="IsChecked" Value="True">
        <Setter TargetName="checkmark" Property="Visibility" Value="Visible" />
        <Setter TargetName="icon" Property="Visibility" Value="Hidden" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="{x:Type MenuItem}" TargetType="{x:Type MenuItem}">
    <Setter Property="Background" Value="{StaticResource MenuItemBackgroundBrush}" />
    <Setter Property="BorderBrush" Value="{StaticResource MenuItemBorderBrush}" />
    <Setter Property="Foreground" Value="{StaticResource MenuItemForegroundBrush}" />
    <Setter Property="Padding" Value="{Binding Source={StaticResource View.Region.Spacing.Normal}, Path=Value}" />
    <!--
            <Setter Property="HorizontalContentAlignment"
            Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
            <Setter Property="VerticalContentAlignment"
            Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        -->
    <Setter Property="ScrollViewer.PanningMode" Value="Both" />
    <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
    <Setter Property="Template" Value="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=SubmenuItemTemplateKey}}" />
    <Style.Triggers>
      <Trigger Property="Role" Value="TopLevelHeader">
        <Setter Property="Template" Value="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=TopLevelHeaderTemplateKey}}" />
        <Setter Property="Background" Value="Transparent" />
      </Trigger>
      <Trigger Property="Role" Value="TopLevelItem">
        <Setter Property="Template" Value="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=TopLevelItemTemplateKey}}" />
        <Setter Property="Background" Value="Transparent" />
      </Trigger>
      <Trigger Property="Role" Value="SubmenuHeader">
        <Setter Property="DockPanel.Dock" Value="Top" />
        <Setter Property="Template" Value="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=SubmenuHeaderTemplateKey}}" />
      </Trigger>
      <Trigger Property="Role" Value="SubmenuItem">
        <Setter Property="DockPanel.Dock" Value="Top" />
        <Setter Property="Margin">
          <Setter.Value>
            <Thickness Bottom="{StaticResource View.Region.Spacing.SmallValue}" Top="{StaticResource View.Region.Spacing.SmallValue}" />
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="IsPressed" Value="true">
        <Setter Property="Background" Value="{StaticResource MenuItemPressedBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource MenuItemPressedBorderBrush}" />
        <Setter Property="Foreground" Value="{StaticResource MenuItemPressedForegroundBrush}" />
      </Trigger>
      <Trigger Property="IsHighlighted" Value="true">
        <Setter Property="Background" Value="{StaticResource MenuItemHoverBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource MenuItemHoverBorderBrush}" />
        <Setter Property="Foreground" Value="{StaticResource MenuItemHoverForegroundBrush}" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="false">
        <Setter Property="Background" Value="{StaticResource MenuItemDisabledBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource MenuItemDisabledBorderBrush}" />
        <Setter Property="Foreground" Value="{StaticResource MenuItemDisabledForegroundBrush}" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style TargetType="{x:Type Menu}">
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="Background" Value="{StaticResource Menu.Background.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource Menu.Foreground.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource Menu.BorderBrush.Normal}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Menu}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
            <ItemsPresenter VerticalAlignment="Center" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter" />
  <Style x:Key="MenuScrollButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="ClickMode" Value="Hover" />
    <Setter Property="MinWidth" Value="0" />
    <Setter Property="MinHeight" Value="0" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border x:Name="ClassicBorder" Background="{TemplateBinding Background}" BorderThickness="1" CornerRadius="{StaticResource Control.Border.CornerRadius}">
            <ContentPresenter Margin="1" HorizontalAlignment="Center" VerticalAlignment="Center" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type FrameworkElement}, ResourceId=MenuScrollViewer}" TargetType="{x:Type ScrollViewer}">
    <Setter Property="HorizontalScrollBarVisibility" Value="Hidden" />
    <Setter Property="VerticalScrollBarVisibility" Value="Auto" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ScrollViewer}">
          <Grid>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
              <RowDefinition Height="*" />
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <RepeatButton Grid.Row="0" Grid.Column="0" Command="{x:Static ScrollBar.LineUpCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" Style="{StaticResource MenuScrollButton}">
              <RepeatButton.Visibility>
                <MultiBinding Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="0" FallbackValue="Visibility.Collapsed">
                  <Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
                  <Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}" />
                  <Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}" />
                  <Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}" />
                </MultiBinding>
              </RepeatButton.Visibility>
              <Path Data="{StaticResource Arrow.Up.Simple}" Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" />
            </RepeatButton>
            <Border Grid.Row="1" Grid.Column="0">
              <ScrollContentPresenter Margin="{TemplateBinding Padding}" />
            </Border>
            <RepeatButton Grid.Row="2" Grid.Column="0" Command="{x:Static ScrollBar.LineDownCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" Style="{StaticResource MenuScrollButton}">
              <RepeatButton.Visibility>
                <MultiBinding Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="100" FallbackValue="Visibility.Collapsed">
                  <Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
                  <Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}" />
                  <Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}" />
                  <Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}" />
                </MultiBinding>
              </RepeatButton.Visibility>
              <Path Data="{StaticResource Arrow.Up.Simple}" Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" RenderTransformOrigin="0.5,0.5">
                <Path.RenderTransform>
                  <TransformGroup>
                    <ScaleTransform />
                    <SkewTransform />
                    <RotateTransform Angle="180" />
                    <TranslateTransform X="NaN" Y="NaN" />
                  </TransformGroup>
                </Path.RenderTransform>
              </Path>
            </RepeatButton>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="{x:Type ContextMenu}" TargetType="{x:Type ContextMenu}">
    <Setter Property="Background" Value="{StaticResource MenuItemBackgroundBrush}" />
    <Setter Property="BorderBrush" Value="{StaticResource Menu.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource MenuItemForegroundBrush}" />
    <Setter Property="Padding">
      <Setter.Value>
        <Thickness />
      </Setter.Value>
    </Setter>
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="Grid.IsSharedSizeScope" Value="true" />
    <Setter Property="HasDropShadow" Value="False" />
    <Setter Property="ScrollViewer.PanningMode" Value="Both" />
    <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ContextMenu}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource Control.Border.CornerRadius}" Padding="{TemplateBinding Padding}">
            <ScrollViewer CanContentScroll="true" Style="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type FrameworkElement}, ResourceId=MenuScrollViewer}}">
              <ItemsPresenter Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" />
            </ScrollViewer>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type Button}">
    <Setter Property="Background" Value="{StaticResource Button.Background.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource Button.Foreground.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource Button.BorderBrush.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource View.Border.Thickness}" />
    <Setter Property="Padding" Value="4" />
    <Setter Property="HorizontalContentAlignment" Value="Center" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource Control.Border.CornerRadius}">
            <ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <!--  COMMON BUTTON  -->
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="true" />
          <Condition Property="IsDefault" Value="false" />
          <Condition Property="IsCancel" Value="false" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <Setter Property="Background" Value="{StaticResource Button.Background.Hover}" />
          <Setter Property="BorderBrush" Value="{StaticResource Button.BorderBrush.Hover}" />
          <Setter Property="Foreground" Value="{StaticResource Button.Foreground.Hover}" />
        </MultiTrigger.Setters>
      </MultiTrigger>
      <Trigger Property="IsFocused" Value="true">
        <!--<Setter Property="Background" Value="{StaticResource Button.Background.Focused}" />-->
        <Setter Property="BorderBrush" Value="{StaticResource Button.BorderBrush.Focused}" />
        <!--<Setter Property="Foreground" Value="{StaticResource Button.Foreground.Focused}" />-->
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsPressed" Value="true" />
          <Condition Property="IsDefault" Value="false" />
          <Condition Property="IsCancel" Value="false" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <Setter Property="Background" Value="{StaticResource Button.Background.Pressed}" />
          <Setter Property="BorderBrush" Value="{StaticResource Button.BorderBrush.Pressed}" />
          <Setter Property="Foreground" Value="{StaticResource Button.Foreground.Pressed}" />
        </MultiTrigger.Setters>
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsEnabled" Value="false" />
          <Condition Property="IsDefault" Value="false" />
          <Condition Property="IsCancel" Value="false" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <Setter Property="Background" Value="{StaticResource Button.Background.Disabled}" />
          <Setter Property="BorderBrush" Value="{StaticResource Button.BorderBrush.Disabled}" />
          <Setter Property="Foreground" Value="{StaticResource Button.Foreground.Disabled}" />
        </MultiTrigger.Setters>
      </MultiTrigger>
      <!--  CANCEL BUTTON  -->
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsDefault" Value="false" />
          <Condition Property="IsCancel" Value="true" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <Setter Property="Background" Value="{StaticResource CancelButton.Background.Normal}" />
          <Setter Property="BorderBrush" Value="{StaticResource CancelButton.BorderBrush.Normal}" />
          <Setter Property="Foreground" Value="{StaticResource CancelButton.Foreground.Normal}" />
        </MultiTrigger.Setters>
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="true" />
          <Condition Property="IsDefault" Value="false" />
          <Condition Property="IsCancel" Value="true" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <Setter Property="Background" Value="{StaticResource CancelButton.Background.Hover}" />
          <Setter Property="BorderBrush" Value="{StaticResource CancelButton.BorderBrush.Hover}" />
          <Setter Property="Foreground" Value="{StaticResource CancelButton.Foreground.Hover}" />
        </MultiTrigger.Setters>
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsFocused" Value="true" />
          <Condition Property="IsDefault" Value="false" />
          <Condition Property="IsCancel" Value="true" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <!--<Setter Property="Background" Value="{StaticResource CancelButton.Background.Focused}" />-->
          <Setter Property="BorderBrush" Value="{StaticResource CancelButton.BorderBrush.Focused}" />
          <!--<Setter Property="Foreground" Value="{StaticResource CancelButton.Foreground.Focused}" />-->
        </MultiTrigger.Setters>
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsPressed" Value="true" />
          <Condition Property="IsDefault" Value="false" />
          <Condition Property="IsCancel" Value="true" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <Setter Property="Background" Value="{StaticResource CancelButton.Background.Pressed}" />
          <Setter Property="BorderBrush" Value="{StaticResource CancelButton.BorderBrush.Pressed}" />
          <Setter Property="Foreground" Value="{StaticResource CancelButton.Foreground.Pressed}" />
        </MultiTrigger.Setters>
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsEnabled" Value="false" />
          <Condition Property="IsDefault" Value="false" />
          <Condition Property="IsCancel" Value="true" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <Setter Property="Background" Value="{StaticResource CancelButton.Background.Disabled}" />
          <Setter Property="BorderBrush" Value="{StaticResource CancelButton.BorderBrush.Disabled}" />
          <Setter Property="Foreground" Value="{StaticResource CancelButton.Foreground.Disabled}" />
        </MultiTrigger.Setters>
      </MultiTrigger>
      <!--  DEFAULT BUTTON  -->
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsDefault" Value="true" />
          <Condition Property="IsCancel" Value="false" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <Setter Property="Background" Value="{StaticResource DefaultButton.Background.Normal}" />
          <Setter Property="BorderBrush" Value="{StaticResource DefaultButton.BorderBrush.Normal}" />
          <Setter Property="Foreground" Value="{StaticResource DefaultButton.Foreground.Normal}" />
        </MultiTrigger.Setters>
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="true" />
          <Condition Property="IsDefault" Value="true" />
          <Condition Property="IsCancel" Value="false" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <Setter Property="Background" Value="{StaticResource DefaultButton.Background.Hover}" />
          <Setter Property="BorderBrush" Value="{StaticResource DefaultButton.BorderBrush.Hover}" />
          <Setter Property="Foreground" Value="{StaticResource DefaultButton.Foreground.Hover}" />
        </MultiTrigger.Setters>
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsFocused" Value="true" />
          <Condition Property="IsDefault" Value="true" />
          <Condition Property="IsCancel" Value="false" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <!--<Setter Property="Background" Value="{StaticResource DefaultButton.Background.Focused}" />-->
          <Setter Property="BorderBrush" Value="{StaticResource DefaultButton.BorderBrush.Focused}" />
          <!--<Setter Property="Foreground" Value="{StaticResource DefaultButton.Foreground.Focused}" />-->
        </MultiTrigger.Setters>
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsPressed" Value="true" />
          <Condition Property="IsDefault" Value="true" />
          <Condition Property="IsCancel" Value="false" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <Setter Property="Background" Value="{StaticResource DefaultButton.Background.Pressed}" />
          <Setter Property="BorderBrush" Value="{StaticResource DefaultButton.BorderBrush.Pressed}" />
          <Setter Property="Foreground" Value="{StaticResource DefaultButton.Foreground.Pressed}" />
        </MultiTrigger.Setters>
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsEnabled" Value="false" />
          <Condition Property="IsDefault" Value="true" />
          <Condition Property="IsCancel" Value="false" />
        </MultiTrigger.Conditions>
        <MultiTrigger.Setters>
          <Setter Property="Background" Value="{StaticResource DefaultButton.Background.Disabled}" />
          <Setter Property="BorderBrush" Value="{StaticResource DefaultButton.BorderBrush.Disabled}" />
          <Setter Property="Foreground" Value="{StaticResource DefaultButton.Foreground.Disabled}" />
        </MultiTrigger.Setters>
      </MultiTrigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="PathButtonStyle" TargetType="{x:Type Controls:PathButton}">
    <Setter Property="Width" Value="Auto" />
    <Setter Property="MinWidth" Value="{Binding ActualHeight, Mode=OneWay, RelativeSource={RelativeSource Self}}" />
    <Setter Property="BorderBrush" Value="{x:Null}" />
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="Padding" Value="0" />
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="Foreground" Value="{StaticResource View.Foreground.Normal}" />
    <Setter Property="VerticalContentAlignment" Value="Stretch" />
    <Setter Property="HorizontalContentAlignment" Value="Center" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Controls:PathButton}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
            <Path HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Data="{TemplateBinding Data}" Fill="{TemplateBinding Foreground}" Stretch="UniformToFill" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Foreground" Value="{StaticResource View.Foreground.Disabled}" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="ExpanderHeaderFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Border>
            <Rectangle Margin="0" SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Padding="{TemplateBinding Padding}">
            <Grid Background="Transparent" SnapsToDevicePixels="False">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="{StaticResource View.MarginSize}" />
                <ColumnDefinition Width="*" />
              </Grid.ColumnDefinitions>
              <Border x:Name="Bd" Width="19" Height="19" BorderThickness="1" SnapsToDevicePixels="true">
                <Path x:Name="arrow" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{StaticResource ExpanderDownArrow}" SnapsToDevicePixels="false" Stroke="{TemplateBinding Foreground}" StrokeThickness="1.5" />
              </Border>
              <ContentPresenter Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Center" RecognizesAccessKey="True" SnapsToDevicePixels="True" />
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="true">
              <Setter TargetName="arrow" Property="Data" Value="{StaticResource ExpanderUpArrow}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Padding="{TemplateBinding Padding}">
            <Grid Background="Transparent" SnapsToDevicePixels="False">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="{StaticResource View.MarginSize}" />
                <ColumnDefinition />
              </Grid.ColumnDefinitions>
              <Border x:Name="Bd" Width="19" Height="19" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" SnapsToDevicePixels="true">
                <Path x:Name="arrow" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5" SnapsToDevicePixels="false" Stroke="{TemplateBinding Foreground}" StrokeThickness="1.5">
                  <Path.LayoutTransform>
                    <RotateTransform Angle="180" />
                  </Path.LayoutTransform>
                </Path>
              </Border>
              <ContentPresenter Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Center" RecognizesAccessKey="True" SnapsToDevicePixels="True" />
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="true">
              <Setter TargetName="arrow" Property="Data" Value="M 1,4.5  L 4.5,1  L 8,4.5" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Padding="{TemplateBinding Padding}">
            <Grid Background="Transparent" SnapsToDevicePixels="False">
              <Grid.RowDefinitions>
                <RowDefinition Height="19" />
                <RowDefinition Height="*" />
              </Grid.RowDefinitions>
              <Border x:Name="Bd" Width="19" Height="19" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" SnapsToDevicePixels="true">
                <Path x:Name="arrow" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5" SnapsToDevicePixels="false" Stroke="{TemplateBinding Foreground}" StrokeThickness="1.5">
                  <Path.LayoutTransform>
                    <RotateTransform Angle="90" />
                  </Path.LayoutTransform>
                </Path>
              </Border>
              <ContentPresenter Grid.Row="1" Margin="0,4,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" RecognizesAccessKey="True" SnapsToDevicePixels="True" />
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="true">
              <Setter TargetName="arrow" Property="Data" Value="M 1,4.5  L 4.5,1  L 8,4.5" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Padding="{TemplateBinding Padding}">
            <Grid Background="Transparent" SnapsToDevicePixels="False">
              <Grid.RowDefinitions>
                <RowDefinition Height="19" />
                <RowDefinition Height="*" />
              </Grid.RowDefinitions>
              <Border x:Name="Bd" Width="19" Height="19" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" SnapsToDevicePixels="true">
                <Path x:Name="arrow" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5" SnapsToDevicePixels="false" Stroke="{TemplateBinding Foreground}" StrokeThickness="1.5">
                  <Path.LayoutTransform>
                    <RotateTransform Angle="-90" />
                  </Path.LayoutTransform>
                </Path>
              </Border>
              <ContentPresenter Grid.Row="1" Margin="0,4,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" RecognizesAccessKey="True" SnapsToDevicePixels="True" />
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="true">
              <Setter TargetName="arrow" Property="Data" Value="M 1,4.5  L 4.5,1  L 8,4.5" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="{x:Type Expander}" TargetType="{x:Type Expander}">
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalContentAlignment" Value="Stretch" />
    <Setter Property="BorderBrush" Value="Transparent" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Expander}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" SnapsToDevicePixels="true">
            <DockPanel>
              <ToggleButton x:Name="HeaderSite" MinWidth="0" MinHeight="0" Margin="1" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" DockPanel.Dock="Top" FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" Focusable="{TemplateBinding Focusable}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" IsChecked="{Binding IsExpanded,                                                               Mode=TwoWay,                                                               RelativeSource={RelativeSource TemplatedParent}}" Padding="{TemplateBinding Padding}" Style="{StaticResource ExpanderDownHeaderStyle}" />
              <ContentPresenter x:Name="ExpandSite" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" DockPanel.Dock="Bottom" Focusable="false" Visibility="Collapsed" />
            </DockPanel>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsExpanded" Value="true">
              <Setter TargetName="ExpandSite" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="ExpandDirection" Value="Right">
              <Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Right" />
              <Setter TargetName="HeaderSite" Property="DockPanel.Dock" Value="Left" />
              <Setter TargetName="HeaderSite" Property="Style" Value="{StaticResource ExpanderRightHeaderStyle}" />
            </Trigger>
            <Trigger Property="ExpandDirection" Value="Up">
              <Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Top" />
              <Setter TargetName="HeaderSite" Property="DockPanel.Dock" Value="Bottom" />
              <Setter TargetName="HeaderSite" Property="Style" Value="{StaticResource ExpanderUpHeaderStyle}" />
            </Trigger>
            <Trigger Property="ExpandDirection" Value="Left">
              <Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Left" />
              <Setter TargetName="HeaderSite" Property="DockPanel.Dock" Value="Right" />
              <Setter TargetName="HeaderSite" Property="Style" Value="{StaticResource ExpanderLeftHeaderStyle}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="{x:Static ToolBar.SeparatorStyleKey}" TargetType="{x:Type Separator}">
    <Setter Property="Foreground" Value="{StaticResource View.Foreground.Disabled}" />
    <Setter Property="Margin" Value="1" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Separator}">
          <Rectangle Height="{TemplateBinding Height}" Stroke="{TemplateBinding Foreground}" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type Controls:CloseWindowButton}">
    <Setter Property="Focusable" Value="False" />
    <Setter Property="Height" Value="{Binding Source={StaticResource ControlBox.Buttons.Size}, Path=Height}" />
    <Setter Property="Width" Value="{Binding Source={StaticResource ControlBox.Buttons.Size}, Path=Width}" />
    <Setter Property="Padding" Value="{StaticResource ControlBox.Buttons.Padding}" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalContentAlignment" Value="Stretch" />
    <Setter Property="Background" Value="{StaticResource ControlBox.Buttons.Close.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource ControlBox.Buttons.Close.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource ControlBox.Buttons.BorderThickness}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Controls:CloseWindowButton}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
            <Path HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Data="{StaticResource CloseGeometry}" Fill="{TemplateBinding Foreground}" Stretch="Uniform" />
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Background.Hover}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.BorderBrush.Hover}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Foreground.Hover}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Background.Pressed}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.BorderBrush.Pressed}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Foreground.Pressed}" />
            </Trigger>
            <!--
                            <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Background.Pressed}" />
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.BorderBrush.Pressed}" />
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Foreground.Pressed}" />
                            </Trigger>
                        -->
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type Controls:NormalizeWindowButton}">
    <Setter Property="Focusable" Value="False" />
    <Setter Property="Height" Value="{Binding Source={StaticResource ControlBox.Buttons.Size}, Path=Height}" />
    <Setter Property="Width" Value="{Binding Source={StaticResource ControlBox.Buttons.Size}, Path=Width}" />
    <Setter Property="Padding" Value="{StaticResource ControlBox.Buttons.Padding}" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalContentAlignment" Value="Stretch" />
    <Setter Property="Background" Value="{StaticResource ControlBox.Buttons.Generic.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource ControlBox.Buttons.Generic.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource ControlBox.Buttons.BorderThickness}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Controls:NormalizeWindowButton}">
          <Border x:Name="border" Background="{TemplateBinding Background}">
            <Path Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Data="{StaticResource NormalizeGeometry}" Fill="{TemplateBinding Foreground}" Stretch="Uniform" />
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Background.Hover}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.BorderBrush.Hover}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Foreground.Hover}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Background.Pressed}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.BorderBrush.Pressed}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Foreground.Pressed}" />
            </Trigger>
            <!--<Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Background.Pressed}" />
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.BorderBrush.Pressed}" />
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Foreground.Pressed}" />
                        </Trigger>-->
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type Controls:MaximizeWindowButton}">
    <Setter Property="Focusable" Value="False" />
    <Setter Property="Height" Value="{Binding Source={StaticResource ControlBox.Buttons.Size}, Path=Height}" />
    <Setter Property="Width" Value="{Binding Source={StaticResource ControlBox.Buttons.Size}, Path=Width}" />
    <Setter Property="Padding" Value="{StaticResource ControlBox.Buttons.Padding}" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalContentAlignment" Value="Stretch" />
    <Setter Property="Background" Value="{StaticResource ControlBox.Buttons.Generic.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource ControlBox.Buttons.Generic.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource ControlBox.Buttons.BorderThickness}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Controls:MaximizeWindowButton}">
          <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
            <Path HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Data="{StaticResource ResourceKey=MaximizeGeometry}" Fill="{TemplateBinding Foreground}" Stretch="Uniform" />
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Background.Hover}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.BorderBrush.Hover}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Foreground.Hover}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Background.Pressed}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.BorderBrush.Pressed}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Foreground.Pressed}" />
            </Trigger>
            <!--<Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Background.Pressed}" />
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.BorderBrush.Pressed}" />
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Foreground.Pressed}" />
                        </Trigger>-->
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type Controls:MinimizeWindowButton}">
    <Setter Property="Focusable" Value="False" />
    <Setter Property="Height" Value="{Binding Source={StaticResource ControlBox.Buttons.Size}, Path=Height}" />
    <Setter Property="Width" Value="{Binding Source={StaticResource ControlBox.Buttons.Size}, Path=Width}" />
    <Setter Property="Padding" Value="{StaticResource ControlBox.Buttons.Padding}" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalContentAlignment" Value="Stretch" />
    <Setter Property="Background" Value="{StaticResource ControlBox.Buttons.Generic.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource ControlBox.Buttons.Generic.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource ControlBox.Buttons.BorderThickness}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Controls:MinimizeWindowButton}">
          <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
            <Path HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Data="{StaticResource MinimizeGeometry}" Fill="{TemplateBinding Foreground}" Stretch="Uniform" />
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Background.Hover}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.BorderBrush.Hover}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Foreground.Hover}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Background.Pressed}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.BorderBrush.Pressed}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Foreground.Pressed}" />
            </Trigger>
            <!--<Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Background.Pressed}" />
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.BorderBrush.Pressed}" />
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Generic.Foreground.Pressed}" />
                        </Trigger>-->
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="CrossButtonStyle" TargetType="{x:Type Button}">
    <Setter Property="Focusable" Value="False" />
    <Setter Property="Height" Value="20" />
    <Setter Property="Width" Value="20" />
    <Setter Property="Padding" Value="4" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalContentAlignment" Value="Stretch" />
    <Setter Property="Background" Value="{StaticResource ControlBox.Buttons.Close.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource ControlBox.Buttons.Close.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource ControlBox.Buttons.BorderThickness}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
            <Path HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Data="{StaticResource CloseGeometry}" Fill="{TemplateBinding Foreground}" Stretch="Uniform" />
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Background.Hover}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.BorderBrush.Hover}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Foreground.Hover}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Background.Pressed}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.BorderBrush.Pressed}" />
              <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Foreground.Pressed}" />
            </Trigger>
            <!--<Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Buttons.Close.Background.Pressed}" />
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Close.BorderBrush.Pressed}" />
                            <Setter Property="Foreground" Value="{StaticResource ControlBox.Close.Foreground.Pressed}" />
                        </Trigger>-->
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="ErrorTemplate">
    <Border Background="{x:Null}" BorderBrush="{StaticResource ErrorTemplate.BorderBrush}" BorderThickness="1" CornerRadius="{StaticResource Control.Border.CornerRadius}">
      <Grid>
        <Path HorizontalAlignment="Right" VerticalAlignment="Top" Data="{StaticResource TopRightLittleCorner}" Fill="{StaticResource ErrorTemplate.BorderBrush}" />
        <AdornedElementPlaceholder x:Name="adorner" Margin="-1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
        <Controls:PopupEx x:Name="errorPopup" AllowsTransparency="True" HorizontalOffset="2" Placement="Right" VerticalOffset="-1">
          <Border Background="{StaticResource ErrorTemplate.BackgroundBrush}" CornerRadius="{StaticResource Control.Border.CornerRadius}">
            <TextBlock Margin="4" Foreground="{StaticResource ErrorTemplate.ForegroundBrush}" Text="{Binding AdornedElement.(Validation.Errors).CurrentItem.ErrorContent,                                                   ElementName=adorner}" />
          </Border>
        </Controls:PopupEx>
      </Grid>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="true">
        <Setter TargetName="errorPopup" Property="IsOpen" Value="True" />
      </Trigger>
      <Trigger Property="IsFocused" Value="true">
        <Setter TargetName="errorPopup" Property="IsOpen" Value="True" />
      </Trigger>
      <DataTrigger Binding="{Binding AdornedElement.IsMouseOver, ElementName=adorner}" Value="true">
        <Setter TargetName="errorPopup" Property="IsOpen" Value="True" />
      </DataTrigger>
      <DataTrigger Binding="{Binding AdornedElement.IsFocused, ElementName=adorner}" Value="true">
        <Setter TargetName="errorPopup" Property="IsOpen" Value="True" />
      </DataTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="{x:Type TextBoxBase}" TargetType="{x:Type TextBoxBase}">
    <Setter Property="Background" Value="{StaticResource TextBox.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource TextBox.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource TextBox.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource View.Border.Thickness}" />
    <Setter Property="Padding" Value="1" />
    <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
    <Setter Property="AllowDrop" Value="true" />
    <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
    <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
    <Setter Property="ContextMenu">
      <Setter.Value>
        <ContextMenu>
          <MenuItem Command="ApplicationCommands.Copy">
            <MenuItem.Icon>
              <Controls:AutoGreyableImage Source="/BillsManager.Views;component\Images/generic/copy-16.png" />
            </MenuItem.Icon>
          </MenuItem>
          <MenuItem Command="ApplicationCommands.Cut">
            <MenuItem.Icon>
              <Controls:AutoGreyableImage Source="/BillsManager.Views;component\Images/generic/cut-16.png" />
            </MenuItem.Icon>
          </MenuItem>
          <MenuItem Command="ApplicationCommands.Paste">
            <MenuItem.Icon>
              <Controls:AutoGreyableImage Source="/BillsManager.Views;component\Images/generic/paste-16.png" />
            </MenuItem.Icon>
          </MenuItem>
        </ContextMenu>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type TextBoxBase}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource Control.Border.CornerRadius}" Padding="{TemplateBinding Padding}">
            <ScrollViewer x:Name="PART_ContentHost" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="IsEnabled" Value="false">
        <Setter Property="Background" Value="{StaticResource TextBox.Background.Disabled}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBox.BorderBrush.Disabled}" />
        <Setter Property="Foreground" Value="{StaticResource TextBox.Foreground.Disabled}" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style BasedOn="{StaticResource {x:Type TextBoxBase}}" TargetType="{x:Type TextBox}">
    <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ErrorTemplate}" />
  </Style>
  <Style TargetType="{x:Type Controls:ListBoxEx}">
    <Setter Property="Background" Value="{StaticResource View.Background}" />
    <Setter Property="BorderBrush" Value="{StaticResource Control.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource View.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="Padding" Value="0" />
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
    <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
    <Setter Property="ScrollViewer.PanningMode" Value="Both" />
    <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Controls:ListBoxEx}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource Control.Border.CornerRadius}" Padding="{TemplateBinding Padding}">
            <ScrollViewer Focusable="false">
              <ItemsPresenter />
            </ScrollViewer>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <MultiDataTrigger>
        <MultiDataTrigger.Conditions>
          <Condition Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Items.Count}" Value="0" />
          <Condition Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=ShowEmptyMessage}" Value="true" />
        </MultiDataTrigger.Conditions>
        <MultiDataTrigger.Setters>
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate>
                <TextBlock Margin="8" HorizontalAlignment="Center" Text="{Binding RelativeSource={x:Static RelativeSource.TemplatedParent},                                                           Path=EmptyMessage}" />
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </MultiDataTrigger.Setters>
      </MultiDataTrigger>
      <Trigger Property="IsGrouping" Value="true">
        <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style TargetType="{x:Type ListBoxItem}">
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="Margin">
      <Setter.Value>
        <Thickness Top="{StaticResource View.Region.Spacing.SmallValue}" />
      </Setter.Value>
    </Setter>
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="BorderBrush" Value="Transparent" />
    <Setter Property="Foreground" Value="{StaticResource ListBoxItem.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="Padding" Value="{StaticResource ListItem.Padding.Normal}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ListBoxItem}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource Control.Border.CornerRadius}" Padding="{TemplateBinding Padding}">
            <ContentPresenter />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="IsMouseOver" Value="true">
        <Setter Property="Background" Value="#FFF0F0F0" />
      </Trigger>
      <Trigger Property="IsSelected" Value="true">
        <Setter Property="Background" Value="{StaticResource ListItem.Background.Selected}" />
        <Setter Property="BorderBrush" Value="{StaticResource ListItem.BorderBrush.Selected}" />
        <Setter Property="Foreground" Value="{StaticResource ListItem.Foreground.Selected}" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style TargetType="{x:Type ListView}">
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="Background" Value="{StaticResource ListItem.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource ListItem.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource ListItem.Foreground.Normal}" />
  </Style>
  <Style TargetType="{x:Type Controls:ListViewEx}" BasedOn="{StaticResource {x:Type ListView}}"></Style>
  <Style TargetType="{x:Type ListViewItem}">
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="Margin">
      <Setter.Value>
        <Thickness Top="{StaticResource View.Region.Spacing.SmallValue}" />
      </Setter.Value>
    </Setter>
    <Setter Property="Padding" Value="{StaticResource ListItem.Padding.Normal}" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="Background" Value="{StaticResource ListItem.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource ListItem.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource ListItem.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource ListItem.BorderThickness.Normal}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ListViewItem}">
          <StackPanel>
            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource Control.Border.CornerRadius}" Padding="{TemplateBinding Padding}">
              <GridViewRowPresenter />
            </Border>
            <Rectangle Height="{StaticResource Separator.Size}" Fill="{StaticResource ListItem.LineDivider.Brush}" IsHitTestVisible="False" />
          </StackPanel>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="ItemsControl.AlternationIndex" Value="0">
        <Setter Property="Background" Value="{StaticResource ListItem.Background.Alternation.1}" />
      </Trigger>
      <Trigger Property="ItemsControl.AlternationIndex" Value="1">
        <Setter Property="Background" Value="{StaticResource ListItem.Background.Alternation.2}" />
      </Trigger>
      <Trigger Property="IsMouseOver" Value="true">
        <Setter Property="Background" Value="{StaticResource ListItem.Background.Hover}" />
        <Setter Property="BorderBrush" Value="{StaticResource ListItem.BorderBrush.Hover}" />
        <Setter Property="Foreground" Value="{StaticResource ListItem.Foreground.Hover}" />
        <!--<Setter Property="BorderThickness" Value="{StaticResource ListItem.BorderThickness.Hover}" />-->
      </Trigger>
      <Trigger Property="IsSelected" Value="true">
        <Setter Property="Background" Value="{StaticResource ListItem.Background.Selected}" />
        <Setter Property="BorderBrush" Value="{StaticResource ListItem.BorderBrush.Selected}" />
        <Setter Property="Foreground" Value="{StaticResource ListItem.Foreground.Selected}" />
        <!--<Setter Property="BorderThickness" Value="{StaticResource ListItem.BorderThickness.Selected}" />-->
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="GridViewColumnHeaderGripperStyle" TargetType="{x:Type Thumb}">
    <Setter Property="HorizontalAlignment" Value="Right" />
    <Setter Property="Width" Value="20" />
    <Setter Property="Margin" Value="0 0 -10 0" />
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Border Background="Transparent" Padding="{TemplateBinding Padding}">
            <Rectangle Width="{StaticResource Separator.Size}" HorizontalAlignment="Center" Fill="{TemplateBinding Background}" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type GridViewColumnHeader}">
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalContentAlignment" Value="Stretch" />
    <Setter Property="Background" Value="{StaticResource GridView.ColumnHeader.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource GridView.ColumnHeader.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource GridView.ColumnHeader.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource GridView.ColumnHeader.BorderThickness.Normal}" />
    <Setter Property="Padding" Value="6" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
          <Grid>
            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
              <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Border>
            <Thumb x:Name="PART_HeaderGripper" Style="{StaticResource GridViewColumnHeaderGripperStyle}" />
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Background" Value="{StaticResource GridView.ColumnHeader.Background.Hover}" />
              <Setter Property="Foreground" Value="{StaticResource GridView.ColumnHeader.Foreground.Hover}" />
              <Setter Property="BorderBrush" Value="{StaticResource GridView.ColumnHeader.BorderBrush.Hover}" />
              <Setter Property="BorderThickness" Value="{StaticResource GridView.ColumnHeader.BorderThickness.Hover}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="Background" Value="{StaticResource GridView.ColumnHeader.Background.Pressed}" />
              <Setter Property="Foreground" Value="{StaticResource GridView.ColumnHeader.Foreground.Pressed}" />
              <Setter Property="BorderBrush" Value="{StaticResource GridView.ColumnHeader.BorderBrush.Pressed}" />
              <Setter Property="BorderThickness" Value="{StaticResource GridView.ColumnHeader.BorderThickness.Pressed}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{StaticResource View.Foreground.Disabled}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="Role" Value="Padding">
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
              <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" />
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="Role" Value="Floating">
        <Setter Property="Opacity" Value="0.65" />
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
              <Canvas Name="PART_FloatingHeaderCanvas">
                <!--<Rectangle Width="{TemplateBinding ActualWidth}"
                                           Height="{TemplateBinding ActualHeight}"
                                           Fill="Black"
                                           Opacity="0.1" />-->
              </Canvas>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="ComboBoxFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Rectangle Stroke="Black" StrokeThickness="0" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ComboBoxEditableTextBox" BasedOn="{StaticResource {x:Type TextBox}}" TargetType="{x:Type TextBox}">
    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
    <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
    <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
    <Setter Property="AllowDrop" Value="true" />
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="BorderBrush" Value="{x:Null}" />
    <Setter Property="Padding" Value="0" />
  </Style>
  <Style x:Key="ComboBoxToggleButtonStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="BorderBrush" Value="{x:Null}" />
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="Foreground" Value="{StaticResource View.Foreground.Normal}" />
    <Setter Property="Padding" Value="4 2" />
    <Setter Property="HorizontalContentAlignment" Value="Center" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource Control.Border.CornerRadius}" Padding="{TemplateBinding Padding}">
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
              </Grid.ColumnDefinitions>
              <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
              <Rectangle Grid.Column="1" Margin="{TemplateBinding Padding}" />
              <Path Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{StaticResource Arrow.Down.Metro}" Fill="{TemplateBinding Foreground}" />
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <!--
            <Style.Triggers>

            <Trigger Property="IsEnabled"
            Value="False">
            <Setter Property="Background"
            Value="{StaticResource Button.Background.Disabled}" />
            <Setter Property="BorderBrush"
            Value="{StaticResource Button.BorderBrush.Disabled}" />
            <Setter Property="Foreground"
            Value="{StaticResource Button.Foreground.Disabled}" />
            </Trigger>

            </Style.Triggers>
        -->
  </Style>
  <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
    <Grid>
      <ToggleButton x:Name="tgb" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" ClickMode="Press" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Focusable="false" Foreground="{TemplateBinding Foreground}" IsChecked="{Binding IsDropDownOpen,                                               Mode=TwoWay,                                               RelativeSource={RelativeSource TemplatedParent}}" Padding="{TemplateBinding Padding}" Style="{StaticResource ComboBoxToggleButtonStyle}">
        <ToggleButton.Content>
          <TextBox x:Name="PART_EditableTextBox" IsReadOnly="{Binding IsReadOnly,                                                   RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxEditableTextBox}" Text="{TemplateBinding Text}" />
        </ToggleButton.Content>
      </ToggleButton>
      <Popup Name="PART_Popup" AllowsTransparency="true" Focusable="False" IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" PopupAnimation="Fade">
        <Border x:Name="DropDownBorder" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource Control.Border.CornerRadius}">
          <!--
                        <Border.CornerRadius>
                        <CornerRadius BottomLeft="{StaticResource Control.Border.CornerRadius.Value}"
                        BottomRight="{StaticResource Control.Border.CornerRadius.Value}"
                        TopLeft="0"
                        TopRight="0" />
                        </Border.CornerRadius>
                    -->
          <ScrollViewer Name="DropDownScrollViewer">
            <ItemsPresenter Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" />
          </ScrollViewer>
        </Border>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger SourceName="PART_EditableTextBox" Property="IsFocused" Value="true">
        <Setter Property="IsDropDownOpen" Value="true" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="{x:Type ComboBox}" TargetType="{x:Type ComboBox}">
    <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ErrorTemplate}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}" />
    <Setter Property="Background" Value="{StaticResource MenuItemBackgroundBrush}" />
    <Setter Property="Foreground" Value="{StaticResource MenuItemForegroundBrush}" />
    <Setter Property="BorderBrush" Value="{StaticResource Control.BorderBrush.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource View.Border.Thickness}" />
    <Setter Property="Padding" Value="4 2" />
    <!--
            <Setter Property="Padding">
            <Setter.Value>
            <Thickness Left="{StaticResource View.Region.Spacing.SmallValue}"
            Top="{StaticResource View.Region.Spacing.SmallValue}"
            Right="{StaticResource View.Region.Spacing.SmallValue}"
            Bottom="{StaticResource View.Region.Spacing.SmallValue}" />
            </Setter.Value>
            </Setter>
        -->
    <Setter Property="StaysOpenOnEdit" Value="True" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
    <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
    <Setter Property="ScrollViewer.PanningMode" Value="Both" />
    <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ComboBox}">
          <Grid>
            <ToggleButton x:Name="tgb" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" ClickMode="Press" Content="{TemplateBinding SelectionBoxItem}" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Focusable="false" Foreground="{TemplateBinding Foreground}" IsChecked="{Binding IsDropDownOpen,                                                           Mode=TwoWay,                                                           RelativeSource={RelativeSource TemplatedParent}}" Padding="{TemplateBinding Padding}" Style="{StaticResource ComboBoxToggleButtonStyle}" />
            <Popup Name="PART_Popup" AllowsTransparency="true" Focusable="False" IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" PopupAnimation="Fade">
              <Border x:Name="DropDownBorder" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource Control.Border.CornerRadius}">
                <!--
                                    <Border.CornerRadius>
                                    <CornerRadius BottomLeft="{StaticResource Control.Border.CornerRadius.Value}"
                                    BottomRight="{StaticResource Control.Border.CornerRadius.Value}"
                                    TopLeft="0"
                                    TopRight="0" />
                                    </Border.CornerRadius>
                                -->
                <ScrollViewer Name="DropDownScrollViewer">
                  <ItemsPresenter Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" />
                </ScrollViewer>
              </Border>
            </Popup>
          </Grid>
          <ControlTemplate.Triggers>
            <!--
                            <Trigger Property="IsDropDownOpen" Value="true">
                            <Setter TargetName="DropDownBorder" Property="CornerRadius">
                            <Setter.Value>
                            <CornerRadius BottomLeft="0"
                            BottomRight="0"
                            TopLeft="{StaticResource Control.Border.CornerRadius.Value}"
                            TopRight="{StaticResource Control.Border.CornerRadius.Value}" />
                            </Setter.Value>
                            </Setter>
                            </Trigger>
                        -->
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="IsEditable" Value="true">
        <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
        <!--
                    <Setter Property="Padding"
                    Value="1 2 4 2" />
                -->
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Background" Value="{StaticResource MenuItemDisabledBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource MenuItemDisabledBorderBrush}" />
        <Setter Property="Foreground" Value="{StaticResource MenuItemDisabledForegroundBrush}" />
      </Trigger>
      <!--
                <Trigger Property="IsFocused"
                Value="true">
                <Setter Property="IsDropDownOpen"
                Value="True" />
                </Trigger>
            -->
      <Trigger Property="HasItems" Value="False">
        <Setter Property="IsEnabled" Value="False" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
    <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
    <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
    <Setter Property="Padding" Value="3" />
    <Setter Property="Margin" Value="0" />
    <Setter Property="Background" Value="{StaticResource ListItem.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource ListItem.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource ListItem.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource View.Border.Thickness}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ComboBoxItem}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0" Padding="{TemplateBinding Padding}">
            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="IsHighlighted" Value="true">
        <Setter Property="Background" Value="{StaticResource ListItem.Background.Selected}" />
        <Setter Property="BorderBrush" Value="{StaticResource ListItem.BorderBrush.Selected}" />
        <Setter Property="Foreground" Value="{StaticResource ListItem.Foreground.Selected}" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="false">
        <Setter Property="Background" Value="{StaticResource Control.Background.Disabled}" />
        <Setter Property="BorderBrush" Value="{StaticResource Control.Background.Disabled}" />
        <Setter Property="Foreground" Value="{StaticResource View.Foreground.Disabled}" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="EmptyCheckBoxFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Border Background="{StaticResource View.Background}" BorderBrush="{StaticResource Control.BorderBrush.Normal}" BorderThickness="{StaticResource View.Border.Thickness}" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="{x:Type CheckBox}" TargetType="{x:Type CheckBox}">
    <Setter Property="Foreground" Value="{StaticResource View.Foreground.Normal}" />
    <Setter Property="Background" Value="{StaticResource View.Background}" />
    <Setter Property="BorderBrush" Value="{StaticResource Control.BorderBrush.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource View.Border.Thickness}" />
    <Setter Property="Padding">
      <Setter.Value>
        <Thickness Left="{StaticResource View.Region.Spacing.SmallValue}" Right="{StaticResource View.Region.Spacing.SmallValue}" />
      </Setter.Value>
    </Setter>
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="HorizontalContentAlignment" Value="Left" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource EmptyCheckBoxFocusVisual}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type CheckBox}">
          <BulletDecorator>
            <BulletDecorator.Bullet>
              <Border x:Name="CheckMark" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource Control.Border.CornerRadius}" Padding="1">
                <Path x:Name="CheckMarkPath" Width="{StaticResource Checkbox.Checkmark.Size}" Height="{StaticResource Checkbox.Checkmark.Size}" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{StaticResource Checkmark3}" Fill="{StaticResource PaidBrush}" Stretch="Uniform" />
              </Border>
            </BulletDecorator.Bullet>
            <BulletDecorator.Child>
              <ContentPresenter Grid.Column="1" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </BulletDecorator.Child>
          </BulletDecorator>
          <ControlTemplate.Triggers>
            <Trigger Property="Content" Value="{x:Null}">
              <Setter Property="Padding" Value="0" />
            </Trigger>
            <Trigger Property="IsChecked" Value="false">
              <Setter TargetName="CheckMarkPath" Property="Visibility" Value="Hidden" />
            </Trigger>
            <Trigger Property="IsChecked" Value="{x:Null}">
              <Setter TargetName="CheckMarkPath" Property="Data" Value="{StaticResource NullCheckedGeometry}" />
              <Setter TargetName="CheckMarkPath" Property="Fill" Value="{StaticResource Checkbox.States.Null.Brush}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter TargetName="CheckMark" Property="Background" Value="{StaticResource {x:Static SystemColors.ControlBrushKey}}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter TargetName="CheckMark" Property="Background" Value="{StaticResource {x:Static SystemColors.ControlBrushKey}}" />
              <Setter TargetName="CheckMarkPath" Property="Fill" Value="{StaticResource {x:Static SystemColors.GrayTextBrushKey}}" />
              <Setter Property="Foreground" Value="{StaticResource {x:Static SystemColors.GrayTextBrushKey}}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type GridSplitter}">
    <Setter Property="Focusable" Value="False" />
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="Foreground" Value="{StaticResource View.Foreground.Disabled}" />
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="Padding" Value="0 1" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type GridSplitter}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
            <!--
                            <Rectangle x:Name="line"
                            UseLayoutRounding="False"
                            VerticalAlignment="Stretch"
                            HorizontalAlignment="Center"
                            Width="{StaticResource Separator.Size}"
                            Fill="{TemplateBinding Foreground}"
                            Visibility="Collapsed"/>
                        -->
          </Border>
          <!--
                        <ControlTemplate.Triggers>
                        
                        <Trigger Property="IsMouseOver"
                        Value="true">
                        <Setter TargetName="line"
                        Property="Visibility"
                        Value="Visible" />
                        </Trigger>
                        
                        </ControlTemplate.Triggers>
                    -->
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type Controls:GridSplitterEx}">
    <Setter Property="Focusable" Value="False" />
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="Foreground" Value="{StaticResource View.Foreground.Disabled}" />
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="Padding" Value="0 1" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Controls:GridSplitterEx}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
            <Grid>
              <Rectangle x:Name="line" Width="{StaticResource Separator.Size}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Fill="{TemplateBinding Foreground}" UseLayoutRounding="False" Visibility="Collapsed" />
              <!--
                                <Popup x:Name="popup"
                                AllowsTransparency="True"
                                Focusable="False"
                                IsOpen="False"
                                Placement="Center"
                                StaysOpen="False">
                                <StackPanel HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Focusable="False"
                                Orientation="Horizontal">
                                <Button Width="30"
                                Command="{x:Static Controls:GridSplitterEx.ShowOnlyNext}"
                                Content="&lt;"
                                Focusable="False" />
                                <Button Width="30"
                                Command="{x:Static Controls:GridSplitterEx.ShowBothEqually}"
                                Content="|"
                                Focusable="False" />
                                <Button Width="30"
                                Command="{x:Static Controls:GridSplitterEx.ShowOnlyPrevious}"
                                Content="&gt;"
                                Focusable="False" />
                                </StackPanel>
                                
                                <Popup.Triggers>
                                
                                <Trigger Property="IsMouseOver" Value="false">
                                <Setter Property="IsOpen" Value="false" />
                                </Trigger>
                                
                                </Popup.Triggers>
                                
                                </Popup>
                            -->
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter TargetName="line" Property="Visibility" Value="Visible" />
              <!--  <Setter TargetName="popup" Property="IsOpen" Value="true" />  -->
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type DatePickerTextBox}">
    <Setter Property="Foreground" Value="{StaticResource View.Foreground.Normal}" />
    <Setter Property="Background" Value="{StaticResource View.Background}" />
    <Setter Property="BorderBrush" Value="{StaticResource Control.BorderBrush.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource View.Border.Thickness}" />
    <Setter Property="Padding" Value="0" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
    <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type DatePickerTextBox}">
          <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
            <Border.CornerRadius>
              <CornerRadius BottomLeft="{StaticResource Control.Border.CornerRadius.Value}" BottomRight="0" TopLeft="{StaticResource Control.Border.CornerRadius.Value}" TopRight="0" />
            </Border.CornerRadius>
            <Grid x:Name="WatermarkContent" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
              <!--
                                <Border x:Name="ContentElement"
                                BorderThickness="{TemplateBinding BorderThickness}" />
                            -->
              <!--  bb #FF45D6FA  -->
              <!--
                                <Border x:Name="FocusVisual"
                                BorderBrush="#FF00FF94"
                                CornerRadius="{StaticResource Control.Border.CornerRadius}"
                                IsHitTestVisible="False"
                                Opacity="1" />
                            -->
              <!--
                                <Border x:Name="watermark_decorator"
                                BorderThickness="{TemplateBinding BorderThickness}">
                            -->
              <ContentControl x:Name="PART_Watermark" Focusable="False" IsHitTestVisible="False" Visibility="Collapsed" />
              <!--  </Border>  -->
              <ScrollViewer x:Name="PART_ContentHost" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="Text" Value="">
              <Setter TargetName="PART_ContentHost" Property="Visibility" Value="Collapsed" />
              <Setter TargetName="PART_Watermark" Property="Visibility" Value="Visible" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type DatePicker}">
    <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ErrorTemplate}" />
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="Foreground" Value="{StaticResource View.Foreground.Normal}" />
    <Setter Property="Background" Value="{StaticResource View.Background}" />
    <Setter Property="BorderBrush" Value="{StaticResource Control.BorderBrush.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource View.Border.Thickness}" />
    <Setter Property="Padding" Value="3 2" />
    <Setter Property="Width" Value="130" />
    <Setter Property="IsTodayHighlighted" Value="True" />
    <Setter Property="SelectedDateFormat" Value="Short" />
    <Setter Property="HorizontalContentAlignment" Value="Center" />
    <Setter Property="HorizontalContentAlignment" Value="Center" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type DatePicker}">
          <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource Control.Border.CornerRadius}">
            <Border.Child>
              <Grid x:Name="PART_Root">
                <Grid.Resources>
                  <ControlTemplate x:Key="DropDownButtonTemplate" TargetType="{x:Type Button}">
                    <Grid>
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                      </Grid.ColumnDefinitions>
                      <Grid.RowDefinitions>
                        <RowDefinition Height="5*" />
                        <RowDefinition Height="15*" />
                      </Grid.RowDefinitions>
                      <Border x:Name="page" Grid.RowSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" />
                      <Border x:Name="header" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" />
                      <TextBlock Grid.Row="1" Grid.RowSpan="2" Margin="0,0,0,2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="12" FontWeight="Medium" Text="{Binding Content,                                                                       RelativeSource={RelativeSource TemplatedParent}}" TextAlignment="Center" />
                    </Grid>
                  </ControlTemplate>
                </Grid.Resources>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Popup x:Name="PART_Popup" AllowsTransparency="True" Placement="Bottom" PlacementTarget="{Binding ElementName=border}" StaysOpen="False" VerticalOffset="-3" />
                <!--  </Grid>  -->
                <DatePickerTextBox x:Name="PART_TextBox" Grid.Column="0" Margin="{TemplateBinding Padding}" HorizontalAlignment="Stretch" VerticalAlignment="Center" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" BorderThickness="0" Focusable="{TemplateBinding Focusable}" Foreground="{TemplateBinding Foreground}" />
                <!--
                                    <Grid x:Name="PART_DisabledVisual"
                                    Grid.ColumnSpan="2"
                                    IsHitTestVisible="False"
                                    Opacity="0">

                                    <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>

                                    <Rectangle Grid.Row="0"
                                    Grid.Column="0"
                                    Fill="#A5FFFFFF"
                                    RadiusX="1"
                                    RadiusY="1" />

                                    <Rectangle Grid.Row="0"
                                    Grid.Column="1"
                                    Width="19"
                                    Height="18"
                                    Margin="3,0,3,0"
                                    Fill="#A5FFFFFF"
                                    RadiusX="1"
                                    RadiusY="1" />
                                -->
                <Button x:Name="PART_Button" Grid.Column="1" Width="{TemplateBinding ActualHeight}" Height="{TemplateBinding ActualHeight}" Margin="0,-1,-1,-1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Content="15" Focusable="False" Foreground="{TemplateBinding Foreground}" Template="{StaticResource DropDownButtonTemplate}" />
              </Grid>
            </Border.Child>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="IsEnabled" Value="false">
        <!--
                    <Setter Property="Background"
                    Value="{StaticResource Button.Background.Disabled}" />
                -->
        <Setter Property="BorderBrush" Value="{StaticResource Control.BorderBrush.Disabled}" />
        <Setter Property="Foreground" Value="{StaticResource View.Foreground.Disabled}" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="ScrollBarFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Rectangle Margin="2" Stroke="{StaticResource ScrollBar.BorderBrush.Normal}" StrokeDashArray="1 2" StrokeThickness="{StaticResource View.Border.Thickness.Value}" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ScrollBarButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ScrollBarFocusVisual}" />
    <Setter Property="HorizontalContentAlignment" Value="Center" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="Height" Value="{StaticResource ScrollBar.Thickness}" />
    <Setter Property="Width" Value="{StaticResource ScrollBar.Thickness}" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource View.Border.Thickness}" />
    <Setter Property="Padding" Value="1" />
    <Setter Property="Visibility" Value="{StaticResource ScrollBar.RepeatButtons.Visibility}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
          </Border>
          <!--
                        <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                        <Setter Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Hover}" />
                        <Setter Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Hover}" />
                        <Setter Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Hover}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                        <Setter Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Pressed}" />
                        <Setter Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Pressed}" />
                        <Setter Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Pressed}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Disabled}" />
                        <Setter Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Disabled}" />
                        <Setter Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Disabled}" />
                        </Trigger>
                        </ControlTemplate.Triggers>
                    -->
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ScrollBarInternalRepeatButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Background" Value="{StaticResource ScrollBar.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource ScrollBar.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource ScrollBar.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Rectangle Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Background" Value="{StaticResource ScrollBar.Thumb.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource ScrollBar.Thumb.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource ScrollBar.Thumb.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource View.Border.Thickness}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" />
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Background" Value="{StaticResource ScrollBar.Thumb.Background.Hover}" />
              <Setter Property="BorderBrush" Value="{StaticResource ScrollBar.Thumb.BorderBrush.Hover}" />
              <Setter Property="Foreground" Value="{StaticResource ScrollBar.Thumb.Foreground.Hover}" />
            </Trigger>
            <Trigger Property="IsDragging" Value="true">
              <Setter Property="Background" Value="{StaticResource ScrollBar.Thumb.Background.Dragging}" />
              <Setter Property="BorderBrush" Value="{StaticResource ScrollBar.Thumb.BorderBrush.Dragging}" />
              <Setter Property="Foreground" Value="{StaticResource ScrollBar.Thumb.Foreground.Dragging}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type ScrollBar}">
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
    <Setter Property="Stylus.IsFlicksEnabled" Value="false" />
    <Setter Property="Background" Value="{StaticResource ScrollBar.Background.Normal}" />
    <Setter Property="BorderBrush" Value="{StaticResource ScrollBar.BorderBrush.Normal}" />
    <Setter Property="Foreground" Value="{StaticResource ScrollBar.Foreground.Normal}" />
    <Setter Property="BorderThickness" Value="{StaticResource View.Border.Thickness}" />
    <Setter Property="Width" Value="{StaticResource ScrollBar.Thickness}" />
    <Setter Property="MinWidth" Value="{StaticResource ScrollBar.Thickness}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ScrollBar}">
          <Grid>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" MaxHeight="{StaticResource ScrollBar.Thickness}" />
              <RowDefinition />
              <RowDefinition Height="Auto" MaxHeight="{StaticResource ScrollBar.Thickness}" />
            </Grid.RowDefinitions>
            <RepeatButton x:Name="PART_LineUpButton" BorderThickness="{TemplateBinding BorderThickness}" Command="{x:Static ScrollBar.LineUpCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}">
              <Path x:Name="ArrowTop" VerticalAlignment="Stretch" Data="{StaticResource Arrow.Up.Metro}" Fill="{Binding Foreground,                                                  RelativeSource={RelativeSource FindAncestor,                                                                                 AncestorType={x:Type RepeatButton}}}" Stretch="Uniform" />
            </RepeatButton>
            <Track x:Name="PART_Track" Grid.Row="1" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}">
              <Track.DecreaseRepeatButton>
                <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource ScrollBarInternalRepeatButton}" />
              </Track.DecreaseRepeatButton>
              <Track.Thumb>
                <Thumb x:Name="Thumb" Style="{StaticResource ScrollBarThumb}" />
              </Track.Thumb>
              <Track.IncreaseRepeatButton>
                <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource ScrollBarInternalRepeatButton}" />
              </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton x:Name="PART_LineDownButton" Grid.Row="2" BorderThickness="{TemplateBinding BorderThickness}" Command="{x:Static ScrollBar.LineDownCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}">
              <Path x:Name="ArrowDown" VerticalAlignment="Stretch" Data="{StaticResource Arrow.Up.Metro}" Fill="{Binding Foreground,                                                  RelativeSource={RelativeSource FindAncestor,                                                                                 AncestorType={x:Type RepeatButton}}}" RenderTransformOrigin="0.5,0.5" Stretch="Uniform">
                <Path.RenderTransform>
                  <TransformGroup>
                    <ScaleTransform />
                    <SkewTransform />
                    <RotateTransform Angle="180" />
                    <TranslateTransform />
                  </TransformGroup>
                </Path.RenderTransform>
              </Path>
            </RepeatButton>
          </Grid>
          <ControlTemplate.Triggers>
            <!--  HOVER NOT PRESSED  -->
            <MultiDataTrigger>
              <MultiDataTrigger.Conditions>
                <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineUpButton}" Value="true" />
                <Condition Binding="{Binding IsPressed, ElementName=PART_LineUpButton}" Value="false" />
              </MultiDataTrigger.Conditions>
              <Setter TargetName="PART_LineUpButton" Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Hover}" />
              <Setter TargetName="PART_LineUpButton" Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Hover}" />
              <Setter TargetName="PART_LineUpButton" Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Hover}" />
            </MultiDataTrigger>
            <MultiDataTrigger>
              <MultiDataTrigger.Conditions>
                <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineDownButton}" Value="true" />
                <Condition Binding="{Binding IsPressed, ElementName=PART_LineDownButton}" Value="false" />
              </MultiDataTrigger.Conditions>
              <Setter TargetName="PART_LineDownButton" Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Hover}" />
              <Setter TargetName="PART_LineDownButton" Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Hover}" />
              <Setter TargetName="PART_LineDownButton" Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Hover}" />
            </MultiDataTrigger>
            <!--  PRESSED  -->
            <MultiDataTrigger>
              <MultiDataTrigger.Conditions>
                <!--  <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineUpButton}" Value="true" />  -->
                <Condition Binding="{Binding IsPressed, ElementName=PART_LineUpButton}" Value="true" />
              </MultiDataTrigger.Conditions>
              <Setter TargetName="PART_LineUpButton" Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Pressed}" />
              <Setter TargetName="PART_LineUpButton" Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Pressed}" />
              <Setter TargetName="PART_LineUpButton" Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Pressed}" />
            </MultiDataTrigger>
            <MultiDataTrigger>
              <MultiDataTrigger.Conditions>
                <!--  <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineDownButton}" Value="true" />  -->
                <Condition Binding="{Binding IsPressed, ElementName=PART_LineDownButton}" Value="true" />
              </MultiDataTrigger.Conditions>
              <Setter TargetName="PART_LineDownButton" Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Pressed}" />
              <Setter TargetName="PART_LineDownButton" Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Pressed}" />
              <Setter TargetName="PART_LineDownButton" Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Pressed}" />
            </MultiDataTrigger>
            <!--  DISABLED  -->
            <Trigger Property="IsEnabled" Value="false">
              <Setter TargetName="PART_LineUpButton" Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Disabled}" />
              <Setter TargetName="PART_LineUpButton" Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Disabled}" />
              <Setter TargetName="PART_LineUpButton" Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Disabled}" />
              <Setter TargetName="Thumb" Property="Background" Value="{StaticResource ScrollBar.Thumb.Background.Disabled}" />
              <Setter TargetName="Thumb" Property="BorderBrush" Value="{StaticResource ScrollBar.Thumb.BorderBrush.Disabled}" />
              <Setter TargetName="Thumb" Property="Foreground" Value="{StaticResource ScrollBar.Thumb.Foreground.Disabled}" />
              <Setter TargetName="PART_LineDownButton" Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Disabled}" />
              <Setter TargetName="PART_LineDownButton" Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Disabled}" />
              <Setter TargetName="PART_LineDownButton" Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Disabled}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="Orientation" Value="Horizontal">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
        <Setter Property="Stylus.IsFlicksEnabled" Value="false" />
        <Setter Property="Background" Value="{StaticResource ScrollBar.Background.Normal}" />
        <Setter Property="BorderBrush" Value="{StaticResource ScrollBar.BorderBrush.Normal}" />
        <Setter Property="Foreground" Value="{StaticResource ScrollBar.Foreground.Normal}" />
        <Setter Property="BorderThickness" Value="{StaticResource View.Border.Thickness}" />
        <Setter Property="Width" Value="Auto" />
        <Setter Property="MinWidth" Value="0" />
        <Setter Property="Height" Value="{StaticResource ScrollBar.Thickness}" />
        <Setter Property="MinHeight" Value="{StaticResource ScrollBar.Thickness}" />
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type ScrollBar}">
              <Grid>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto" MaxWidth="{StaticResource ScrollBar.Thickness}" />
                  <ColumnDefinition />
                  <ColumnDefinition Width="Auto" MaxWidth="{StaticResource ScrollBar.Thickness}" />
                </Grid.ColumnDefinitions>
                <RepeatButton x:Name="PART_LineLeftButton" BorderThickness="{TemplateBinding BorderThickness}" Command="{x:Static ScrollBar.LineLeftCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}">
                  <Path x:Name="ArrowLeft" Width="{Binding Source={StaticResource Path.Size},                                                           Path=Width}" Height="{Binding Source={StaticResource Path.Size},                                                            Path=Height}" Data="{StaticResource Arrow.Up.Metro}" Fill="{Binding Foreground,                                                          RelativeSource={RelativeSource FindAncestor,                                                                                         AncestorType={x:Type RepeatButton}}}" RenderTransformOrigin="0.5,0.5" Stretch="Uniform">
                    <Path.RenderTransform>
                      <TransformGroup>
                        <ScaleTransform />
                        <SkewTransform />
                        <RotateTransform Angle="270" />
                        <TranslateTransform />
                      </TransformGroup>
                    </Path.RenderTransform>
                  </Path>
                </RepeatButton>
                <Track x:Name="PART_Track" Grid.Column="1" IsEnabled="{TemplateBinding IsMouseOver}">
                  <Track.DecreaseRepeatButton>
                    <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource ScrollBarInternalRepeatButton}" />
                  </Track.DecreaseRepeatButton>
                  <Track.Thumb>
                    <Thumb x:Name="Thumb" Style="{StaticResource ScrollBarThumb}" />
                  </Track.Thumb>
                  <Track.IncreaseRepeatButton>
                    <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource ScrollBarInternalRepeatButton}" />
                  </Track.IncreaseRepeatButton>
                </Track>
                <RepeatButton x:Name="PART_LineRightButton" Grid.Column="2" BorderThickness="{TemplateBinding BorderThickness}" Command="{x:Static ScrollBar.LineRightCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}">
                  <Path x:Name="ArrowRight" Width="{Binding Source={StaticResource Path.Size},                                                           Path=Width}" Height="{Binding Source={StaticResource Path.Size},                                                            Path=Height}" VerticalAlignment="Center" Data="{StaticResource Arrow.Up.Metro}" Fill="{Binding Foreground,                                                          RelativeSource={RelativeSource FindAncestor,                                                                                         AncestorType={x:Type RepeatButton}}}" RenderTransformOrigin="0.5,0.5" Stretch="Uniform">
                    <Path.RenderTransform>
                      <TransformGroup>
                        <ScaleTransform />
                        <SkewTransform />
                        <RotateTransform Angle="90" />
                        <TranslateTransform />
                      </TransformGroup>
                    </Path.RenderTransform>
                  </Path>
                </RepeatButton>
              </Grid>
              <ControlTemplate.Triggers>
                <!--  HOVER NOT PRESSED  -->
                <MultiDataTrigger>
                  <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineLeftButton}" Value="true" />
                    <Condition Binding="{Binding IsPressed, ElementName=PART_LineLeftButton}" Value="false" />
                  </MultiDataTrigger.Conditions>
                  <Setter TargetName="PART_LineLeftButton" Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Hover}" />
                  <Setter TargetName="PART_LineLeftButton" Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Hover}" />
                  <Setter TargetName="PART_LineLeftButton" Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Hover}" />
                </MultiDataTrigger>
                <MultiDataTrigger>
                  <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineRightButton}" Value="true" />
                    <Condition Binding="{Binding IsPressed, ElementName=PART_LineRightButton}" Value="false" />
                  </MultiDataTrigger.Conditions>
                  <Setter TargetName="PART_LineRightButton" Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Hover}" />
                  <Setter TargetName="PART_LineRightButton" Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Hover}" />
                  <Setter TargetName="PART_LineRightButton" Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Hover}" />
                </MultiDataTrigger>
                <!--  PRESSED  -->
                <MultiDataTrigger>
                  <MultiDataTrigger.Conditions>
                    <!--  <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineUpButton}" Value="true" />  -->
                    <Condition Binding="{Binding IsPressed, ElementName=PART_LineLeftButton}" Value="true" />
                  </MultiDataTrigger.Conditions>
                  <Setter TargetName="PART_LineLeftButton" Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Pressed}" />
                  <Setter TargetName="PART_LineLeftButton" Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Pressed}" />
                  <Setter TargetName="PART_LineLeftButton" Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Pressed}" />
                </MultiDataTrigger>
                <MultiDataTrigger>
                  <MultiDataTrigger.Conditions>
                    <!--  <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineDownButton}" Value="true" />  -->
                    <Condition Binding="{Binding IsPressed, ElementName=PART_LineRightButton}" Value="true" />
                  </MultiDataTrigger.Conditions>
                  <Setter TargetName="PART_LineRightButton" Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Pressed}" />
                  <Setter TargetName="PART_LineRightButton" Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Pressed}" />
                  <Setter TargetName="PART_LineRightButton" Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Pressed}" />
                </MultiDataTrigger>
                <!--  DISABLED  -->
                <Trigger Property="IsEnabled" Value="false">
                  <Setter TargetName="PART_LineLeftButton" Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Disabled}" />
                  <Setter TargetName="PART_LineLeftButton" Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Disabled}" />
                  <Setter TargetName="PART_LineLeftButton" Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Disabled}" />
                  <Setter TargetName="Thumb" Property="Background" Value="{StaticResource ScrollBar.Thumb.Background.Disabled}" />
                  <Setter TargetName="Thumb" Property="BorderBrush" Value="{StaticResource ScrollBar.Thumb.BorderBrush.Disabled}" />
                  <Setter TargetName="Thumb" Property="Foreground" Value="{StaticResource ScrollBar.Thumb.Foreground.Disabled}" />
                  <Setter TargetName="PART_LineRightButton" Property="Background" Value="{StaticResource ScrollBar.RepeatButton.Background.Disabled}" />
                  <Setter TargetName="PART_LineRightButton" Property="BorderBrush" Value="{StaticResource ScrollBar.RepeatButton.BorderBrush.Disabled}" />
                  <Setter TargetName="PART_LineRightButton" Property="Foreground" Value="{StaticResource ScrollBar.RepeatButton.Foreground.Disabled}" />
                </Trigger>
              </ControlTemplate.Triggers>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style TargetType="{x:Type StatusBar}">
    <Setter Property="Background" Value="{StaticResource DBConnectionState.NotConnected}" />
    <Style.Triggers>
      <DataTrigger Binding="{Binding ConnectionState, Mode=OneWay}" Value="{x:Static Models:DBConnectionState.Disconnected}">
        <Setter Property="Background" Value="{StaticResource DBConnectionState.NotConnected}" />
      </DataTrigger>
      <DataTrigger Binding="{Binding ConnectionState, Mode=OneWay}" Value="{x:Static Models:DBConnectionState.Connected}">
        <Setter Property="Background" Value="{StaticResource DBConnectionState.Connected}" />
      </DataTrigger>
      <DataTrigger Binding="{Binding ConnectionState, Mode=OneWay}" Value="{x:Static Models:DBConnectionState.Unsaved}">
        <Setter Property="Background" Value="{StaticResource DBConnectionState.Unsaved}" />
      </DataTrigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="DetailHeaderTextblockStyle" TargetType="{x:Type TextBlock}">
    <Setter Property="Foreground" Value="{StaticResource View.Region.Title.Foreground}" />
    <Setter Property="FontWeight" Value="{StaticResource View.Region.Title.FontWeight}" />
    <Setter Property="HorizontalAlignment" Value="Right" />
    <Setter Property="VerticalAlignment" Value="Top" />
  </Style>
</ResourceDictionary>